In Rails 3 and higher:
Rails.application.routes.url_helpers
e.g.
Rails.application.routes.url_helpers.posts_path
Rails.application.routes.url_helpers.posts_url(:host => "example.com")
More Related Contents:
- Rails 3 link_to (:method => :delete) not working
- Rails Routes based on condition
- How can I use Rails routes to redirect from one domain to another?
- How to create app-wide slug routing for Rails app?
- PG::ConnectionBad – could not connect to server: Connection refused
- Ruby on Rails and Rake problems: uninitialized constant Rake::DSL
- Add querystring parameters to link_to
- How to solve “certificate verify failed” on Windows?
- Rails keeps telling me that it’s not currently installed
- Rails: fields_for with index?
- Nokogiri installation fails -libxml2 is missing
- Get person’s age in Ruby
- Ruby Bundle Symbol not found: _SSLv2_client_method (LoadError)
- How do you configure WEBrick to use SSL in Rails?
- Adding lib to ‘config.autoload_paths’ in Rails 3 does not autoload my module
- @ variables in Ruby on Rails
- belongs_to through associations
- Rails migration for has_and_belongs_to_many join table
- How to get request referer path?
- Can I write PostgreSQL functions on Ruby on Rails?
- Double colons before class names in Ruby?
- Slow initial server startup when using Phusion Passenger and Rails
- How do I ignore the authenticity token for specific actions in Rails?
- How to get started on TDD with Ruby on Rails? [closed]
- Setting session length with Devise
- How can I disable logging in Ruby on Rails on a per-action basis?
- strong parameters permit all attributes for nested attributes
- Template is missing
- Is the server running on host “localhost” (::1) and accepting TCP/IP connections on port 5432?
- How to programmatically list all controllers in Rails