Questions tagged [rails-routing]

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

955 questions
0
votes
1 answer

Form without model, add to namespace

I recently added namespaces to my rails app. I had a form that will email owners, but it seems to have broken in the process (error at bottom). The form does not have a model, it just kicks off an email. Here is my routes file scope ":locale",…
ruevaughn
  • 1,279
  • 1
  • 16
  • 44
0
votes
1 answer

Namespacing routes file provides routing error

I am trying to namespace my site into owner / admin, and hitting a routing error. When I try to create a new Financial Report (http://localhost:3000/en/admin/financial_reports/new) I get No route matches {:controller=>"financial_reports",…
ruevaughn
  • 1,279
  • 1
  • 16
  • 44
0
votes
1 answer

Rails app saying can't find users route, should be working

I have having a problem logging into my existing app with custom authorization. When I login, I get the error No route matches {:action=>"show", :controller=>"users", :locale=>#
ruevaughn
  • 1,279
  • 1
  • 16
  • 44
0
votes
2 answers

Routes - how to display in url ID and the name of article?

I have the Articles controller and for displaying the respective article I use the basic routes - example.com/articles/4. I would like to change this URL format to example.com/4-article-name or example.com/article-name-4. Could anyone give me a tip,…
user984621
  • 41,002
  • 66
  • 200
  • 371
0
votes
2 answers

Rails routing error: app can't perform POST

I'm working through Ryan Bates' Railscast #124: Beta Invitations. I've got all the code in place, but I haven't been able to actually get things working. When I try to send an invite email, I get this message. Routing Error No route…
Ben Downey
  • 2,213
  • 4
  • 30
  • 53
0
votes
1 answer

I can't get my search form and result views to render - using Thinking-sphinx along side existing search

I have a 2.3.11 Rails app, and I would like to add a fulltext search to be able to search on the 'articles' content and title. I am using Thinking-sphinx for this purpose. I just want to be able to click on the search link_to '/advanced_search'…
Alkindi
  • 45
  • 8
0
votes
0 answers

Rails 3: Working with Heavily Nested Routes

I am looking for a better solution than what I currently have for my routes. They are deeply nested and there has to be a better solution for what I have done (thus far). This is what I have so far: namespace "api" do namespace "v1" do …
dennismonsewicz
  • 23,382
  • 26
  • 107
  • 175
0
votes
2 answers

Rails route not working - not sure why

Having a routing issue, should be really simple but seems straightforward and just not working: match '/api/get-locations-by-distance/:latitude/:longitude' => 'api#get_locations_by_distance' with this…
timpone
  • 17,029
  • 31
  • 103
  • 200
0
votes
1 answer

Rails 3 - default_url_options based on url being generated

In rails 3, is it possible to gain access to the controller/action of the URL being generated inside of default_url_options()? In rails 2 you were passed a Hash of the options that were about to be passed to url_for() that you could of course…
-1
votes
1 answer

How can I route to a belongs_to table in Rails (using PostgreSQL)?

My relationship is as follows: Users have many Cartitems; Cartitems belong to Users, Cartitems have many Products; Products belong to Cartitems Therefore, Users have many Products through Cartitems and Cartitems have many Users through products. I…
deejay123
  • 79
  • 5
-1
votes
2 answers

How to hide :id in rails url?

I have these nested routes, and I want to hide the id param from the url. resources :shares, only: [:index, :create, :update] do resource :wizard, path: "trade" do get :first_object get :second_object get :confirmation post…
calyxofheld
  • 361
  • 1
  • 15
  • 35
-1
votes
2 answers

How to load controller method from reqs string like "controller#action"

I want to load the instance method of create from the reqs string(routing term) and then find its source location This is how you would define it in the routes file get "route_name" => "controller#action" Typically, you can do this by using the…
SoWhat
  • 5,204
  • 2
  • 24
  • 54
-1
votes
1 answer

Rails 4 - nested resource under singleton resource

I have a Rails 4 app and currently implementing a shopping cart. i dont want to reveal the user id, cart id but only the cart items id in the url. so basically, i want my routes to be something like ;- /user/cart/plans => show all…
Milind
  • 4,136
  • 1
  • 21
  • 51
-1
votes
2 answers

getting No route matches [GET] "/show_house_search.38" in rails

I defined a new method in my controller to show customized show page for my houses after one click on search results. houses_controller.rb def show_house_search @house = House.find(params[:id]) @photos = @house.photos end then I declared…
Nischay Namdev
  • 485
  • 5
  • 20
-1
votes
1 answer

what is difference between resourceful and non resourceful routes

Difference between resourceful and non resourceful routes? Actually I know one difference that we can create our custom paths in non resourceful routes. But this routes can also be possible by member and collection in resourceful routes. So what…
Nimish
  • 867
  • 10
  • 25
1 2 3
63
64