The component of the Ruby on Rails framework responsible for mapping between HTTP requests and application resources (including static files and controller actions).
Questions tagged [rails-routing]
969 questions
0
votes
1 answer
Rails resources routes for admin namespace, error when generating a form
I have an admin namespace in routes with users controller:
namespace :admin do
resources :users
end
So i have users_controller.rb in /admin folder, and a User model. In my _form partial i am trying to create a form for both new and edit actions,…

Tamik Soziev
- 14,307
- 5
- 43
- 55
0
votes
2 answers
Avoid index url after failing create
When you create a User in rails through the create action, the url is changed to
http://myapplication.com/users with POST
before being redirected elsewhere. If validation fails, it appears that the above URL is retained. If you then refresh, you…

pingu
- 8,719
- 12
- 50
- 84
0
votes
1 answer
rails mailer generating invalid URL
I am trying to add password reset functionality to my rails app using action mailer. Everything seems to be working fine except that the generated link to reset the password is incorrect.
Here are the files:
File user_mailer.rb:
class UserMailer <…

Kiran
- 5,478
- 13
- 56
- 84
0
votes
1 answer
Rails 3 Route Nesting
My Rails app routing looks something like this:
match 'Events/New' => 'event#new'
match 'Events/:date' => 'event#show', :date => /[A-Z][a-z]{2}-\d{2}-\d{4}/
match 'Events/:date/Venue' => 'event#venue', :date => /[A-Z][a-z]{2}-\d{2}-\d{4}/
match…

Colin
- 2,814
- 5
- 27
- 37
0
votes
1 answer
Routing error - passing a parameter to update action from link_to
I have a booking model, I want the user to confirm/reject a booking by clicking on one link or the other. I'm trying to avoid having to create a form.
here is how I tried implementing it:
<% @bookings.each do |booking| %>
<%= link_to…

Benamir
- 1,107
- 2
- 11
- 24
0
votes
1 answer
Rails: singular resource update path issue
I'm struggling to get the correct url to give to form_for for update action to work on singular ressources.
My routes.rb is as follow:
scope "(:locale)", :locale => /en|fr/ do
namespace :quickwizard, :module => 'quick_wizard' do
resource…

Nathan Appere
- 158
- 1
- 7
0
votes
1 answer
RAILS 3.2: How to rescue from "Routing Error" page
How to rescue from RoutingError in Rails 3.2 applications such as redirecting to root_path?

smileymike
- 253
- 6
- 22
0
votes
1 answer
rails adding "static_content" on routes
I have routes that work perfectly on one machine, but on another machine they are failing and I've had a hard time to figure out what is wrong. On the failing machine it return the following errors for get /groups/my and groups/ respectively
No…

serengeti12
- 5,205
- 4
- 23
- 27
0
votes
1 answer
Wicked No route matches
I'm following A Wicked exampe to build my wizard, except I am creating the model in a dedicated controller first then on save redirecting to the steps controller but I'm getting a routing error saying:
No route matches {:action=>"show",…

Jaijaz
- 134
- 1
- 12
0
votes
1 answer
rails syntax issue in file routes.rb
My folders have the following structure:
root is /home3/username
My web app is under rails_apps/my_app/ so my views are under rails_apps/my_app/app/views
username@company.com [~]# ls -la rails_apps/my_app/app/views/
total 24
drwxr-xr-x 6 username…

rh4games
- 962
- 2
- 15
- 38
0
votes
1 answer
Bound Parameters in Ruby on Rails
I’ve previously asked a question related to this topic as well and with the aid of that question I’ve found the name of exactly what I wanted: “bound parameters”.
I have managed to create a routing like "user/:id/dosomething" by adding a member to…

Ali
- 5,338
- 12
- 55
- 78
0
votes
1 answer
Custom Functions in Rails
I'm a rails beginner and I'm trying to get the concept down in my head. Even though we have functions like "index, show" I was wondering the custom functions, like whether we can create them
I'm developing the back end of a mobile application and I…

Ali
- 5,338
- 12
- 55
- 78
0
votes
1 answer
Routing error in thumbs_up
I followed the steps indicated in this answer for setting up thumbs_up
https://stackoverflow.com/a/4963297/1643048
However I keep getting this error and have no idea how to fix it:
No route matches {:action=>"vote_up", :controller=>"posts",…

amritha
- 75
- 1
- 6
0
votes
1 answer
Edit path for nested polymorphic resources
I have a nested polymorphic resource, question, which may be nested beneath an exam. In the UI I build a form dynamically, using POST as the submit method. This works fine for the new action, POSTing to /exams/1/questions.
The issue is that for the…

apchester
- 1,154
- 3
- 11
- 30
0
votes
0 answers
Trying to figure out nested scopes in Rails routing
I have a site where I'm making URLs look like the following (for users to view information):
/:state/:data_type/:category/:subcategory/:item_id
data_type is one of "directory", "articles", or "documents". The idea is to store information for each…

Michael Chaney
- 2,911
- 19
- 26