Module: Swamp::Action::Routes
- Defined in:
- lib/swamp/rails_actions/action/routes.rb
Instance Method Summary collapse
- #path(name, options = Hash[]) ⇒ Object
- #router ⇒ Object
- #router_default_url_options ⇒ Object
- #url(name, options = Hash[]) ⇒ Object
Instance Method Details
#path(name, options = Hash[]) ⇒ Object
9 10 11 |
# File 'lib/swamp/rails_actions/action/routes.rb', line 9 def path(name, = Hash[]) router.send(:"#{name}_path", .merge()) end |
#router ⇒ Object
5 6 7 |
# File 'lib/swamp/rails_actions/action/routes.rb', line 5 def router @router ||= Rails.application.routes end |
#router_default_url_options ⇒ Object
17 18 19 20 21 |
# File 'lib/swamp/rails_actions/action/routes.rb', line 17 def Hash[].tap do |opts| opts[:host] = @request.host if @request end end |
#url(name, options = Hash[]) ⇒ Object
13 14 15 |
# File 'lib/swamp/rails_actions/action/routes.rb', line 13 def url(name, = Hash[]) router.send(:"#{name}_url", .merge()) end |