Top "Rails-routing" questions

The component of the Ruby on Rails framework responsible for mapping between HTTP requests and application resources (including static files and controller actions).

Rails 3 link_to (:method => :delete) not working

I'm having trouble with my verbs in Rails... viewing a page for a resource (Dog) which has_many (Fleas). Embedded …

ruby-on-rails routing rails-routing
How to change a route name rails 4

I changed the routing of posts#index to match blog and I now get /blog in the URL which I …

ruby-on-rails ruby-on-rails-4 rails-routing
Routing Error -- No route matches [POST] "/posts/new"

I'm working through the rubyonrails.org 'blog tutorial', and get this error when I try to submit a 'post' : Routing …

ruby-on-rails rails-routing
Rails route: define root to namespace

I've got 2 controllers: app/ /controllers posts_controllers.rb /mobile posts_controllers.rb and my routes.rb looks like this: root :…

ruby-on-rails ruby rails-routing
Rails Routes based on condition

I have three roles: Instuctor, Student, Admin and each have controllers with a "home" view. so this works fine, get "…

ruby-on-rails ruby-on-rails-3 routes ruby-on-rails-3.2 rails-routing
Routes with Dash `-` Instead of Underscore `_` in Ruby on Rails

I want my urls to use dash - instead of underscore _ as word separators. For example controller/my-action instead of …

ruby-on-rails routing rails-routing
How to add parameter to rails index action/method?

I want to pass a parameter to the index action, but the I'm only getting the show action. routes.rb: …

ruby-on-rails ruby ruby-on-rails-3 parameter-passing rails-routing
Ruby on Rails: Get the controller and action name based on a path

I am trying to get the controller and action name based on a path. I have a route: map.resources :…

ruby-on-rails rails-routing
How can I use Rails routes to redirect from one domain to another?

My app used to run on foo.tld but now it runs on bar.tld. Requests will still come in …

ruby-on-rails routing rails-routing
grouping controller in subdirectories for nested resources

I would like to organize my controllers in subdirectories. Here is an example: routes.rb: resources :locations do resources :users …

ruby-on-rails-3 rails-routing