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]
955 questions
-1
votes
1 answer
change the parameters of url if it contains space within
For example I have written a route like
get '/post/:name'
If name have some value like my first post
and I want to change the value of param abc to 'my-first-post'. please help.
![](../../users/profiles/5111011.webp)
OzAs
- 23
- 4
-1
votes
1 answer
events/[event_id]/attendances in rails
I'm building an events application, and I want to be able to retrieve each event's attendances by hitting an endpoint structured as in the question title: events/[event_id]/attendances. How do I declare such a route in routes.rb?
![](../../users/profiles/4135345.webp)
modsoussi
- 137
- 10
-1
votes
1 answer
Log and control ActionController::RoutingError: No route matches
Very often, we get hits to non-existing urls like phpadmin.php, admin.php, testproxy.php and so on.
We would like to capture such non exsiting url and avoid raising rails error but a decent 404. What is the best way to achieve this in Rails 4?
Thank…
![](../../users/profiles/361142.webp)
prabu
- 5,691
- 7
- 31
- 37
-1
votes
1 answer
How can I scope a resource so that the path helpers are scoped?
Super simple goal that doesn't seem to be well documented, I'd like to scope a resource & have the path (& url) helpers generate the scoped paths.
ie:
scope :info do
resources :publications
end
publications_path =>…
![](../../users/profiles/2250791.webp)
Camden Narzt
- 2,359
- 19
- 36
-1
votes
2 answers
Rails: NoMethodError(s). Can't access pages
I keep getting a NoMethodError regardless of where I try and go. Going to http://localhost:3000/ gives me an undefined method new_movie_rentals_path' error. And going somewhere such as http://localhost:3000/movies/5/rentals/new (and there should be…
![](../../users/profiles/4466048.webp)
roguerat
- 219
- 3
- 16
-1
votes
2 answers
form submit in rails not working, possible routing/path error unsure why?
I am trying to submit a form in rails that is just a pdf uplaod (using paperclip). There is something wrong with either my form, controller or model and i am not sure which.
this is my form:
<%= form_for @yearguide, :html => { :multipart => true }…
![](../../users/profiles/3290423.webp)
rico_mac
- 810
- 6
- 21
-1
votes
1 answer
preview page signup redirecting to another static page error
I have a preview page up with a form that takes in emails(@premails). I've created a model & migration for this.
I have a pages controller with a Home, About & Contact actions and corresponding views.
After they submit their email on the Home page,…
![](../../users/profiles/3408293.webp)
user3408293
- 1,277
- 6
- 17
- 25
-2
votes
1 answer
In rails routes, nested resources is causing white screen
I have two models: Schedule and Project. Schedule belongs_To Project and Project has_one schedule. The routes for schedule and Project are nested like this:
get 'projects/current', to: 'projects#show_current', as:…
![](../../users/profiles/1959050.webp)
Philip7899
- 4,189
- 2
- 44
- 99
-3
votes
2 answers
error in routing
When I open http://localhost:3000/users I'm getting following routing error:
No route matches {:action=>"req", :controller=>"friendship", :id=>"admin@ascratech.com"}
How to solve this?
Inside users/index.html.erb :
-
<% @users.each do |user|…
![](../../users/profiles/1225028.webp)
Nikita
- 9
- 5
-3
votes
1 answer
No route matches?
I'm getting a "No route matches" exception in one of my tests (and using curl from the command line) one of my routes (POST /users/confirm). The curl's I've tried are as follows, neither of them work and receive the same exceptions outlined in the…
![](../../users/profiles/416122.webp)
gangelo
- 2,616
- 3
- 24
- 36