Class: Jets::Router::Resources::Options
- Defined in:
- lib/jets/router/resources/options.rb
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Jets::Router::Resources::Base
Instance Method Details
#build(action) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/jets/router/resources/options.rb', line 3 def build(action) # Important to create a copy of the options since we are mutating it # The original options are used for resources and resource scope = @options.dup # Remove special options from getting to create_route. For some reason .slice! doesnt work .delete(:only) .delete(:except) controller = [:singular_resource] ? @name.to_s.pluralize : @name [:to] = "#{controller}##{action}" end |