All Questions
Tagged with routes ruby-on-rails-4
653
questions
1
vote
0
answers
95
views
I do not know why I get the following error:uninitialized constant Games Object.const_get(camel_cased_word) ^
I work on a Rails project and I seem to have a route or controller problem which I do not understand. This is the error I receive: uninitialized constant Games Object.const_get(camel_cased_word) ^^^^^^...
0
votes
0
answers
104
views
How to solve no method error in ruby on rails?
I defined my route and controller actions correctly. Still I'm getting a no method error.
Here is my code:
Route:
get "/restaurants", to: "restaurants#index"
Controller action:
...
2
votes
2
answers
54
views
How to Write link_to for acts_as_votable nested resources?
I am trying to add voting to my site. I have improvements that are created and displayed inside of the projects show page. I'm trying to allow users to vote on improvements but I am getting an error ...
1
vote
1
answer
145
views
How to avoid double underscores in Rails 5 nested resource namespaced routes
We have some nested resource/namespace routes that worked before upgrading to Rails 5 as is, but now with Rails 5 the routes are complaining about not having an explicit as: on the route to name the ...
0
votes
1
answer
89
views
How can I get the rails router to choose controller dynamically from content?
I'm building a playlist feature that can hold different types and I need a generic url helper that would go to the a controller#action depending on the type of object passed to it.
For example:
...
1
vote
0
answers
68
views
Bad URI in rake routes rails
config/routes.rb
get '/news-views(/:page)',to: redirect("/car-news/%{page}")
when I hit
/news-views/
it gives an Bad Uri but when I hit/news-views/1 it works
i want it to work without page also
0
votes
0
answers
132
views
Rails - Multiple Models with root sluggable routes
I'm looking for advice to find the ideal solution that fits within Rails' best practises.
My app has 5 models:
Category
Place
Division
Subdivision
Item (polymorphic)
A Place belongs to a Category. ...
2
votes
1
answer
2k
views
ActionController::RoutingError: No route matches [GET] "/"
I have a Rails API which is being accessed by my React client-side. Every time the react application is loaded it makes a get request to the API for the path / and this raises the error:
...
0
votes
1
answer
427
views
Changing the url on selecting a tab
I have various tab in my page which has url profile and when a tab is selected i want the url to change from profile to profile/*selected_tab_name*. The url is changed to what i need when the details ...
0
votes
1
answer
660
views
DRY rspec test with routing
I spent several hours trying to make my rspec test work. And as a result I got not really DRY tests which I want optimize somehow.
They look like the following:
describe ExtApi::BaseController do
...
0
votes
2
answers
5k
views
Routing Error uninitialized constant controller
I'm am trying to learn Ruby on rails and I keep getting this error.
My controller is
class Clasa9Controller < ApplicationController
def multimi
end
def progresii
end
def functii
end
...
1
vote
1
answer
50
views
Link_to object stop working on dynamic route segments
i have routes nested in a scope like following:
scope ':school_domain' do
resources :users
...
end
link_to('view', current_user) stops working but when i remove scope or add defaults: {...
0
votes
1
answer
622
views
Rails route masking
I have a rails app where I have a userpage. Each userpage is a dashboard for a user showing his listings and his activities. I am also using a User model which is coming from devise so I can't use ...
1
vote
1
answer
191
views
Devise signed_in user giving 401 unauthorized
I have a rails application and I'm adding a feature to auto-login users using confirmation tokens sent to them as a part of the URL in email links.
I added the following to my application_controller....
4
votes
2
answers
1k
views
Rails reload dynamic routes on multiple instances/servers
How can we force Rails to reload_routes on multiple servers/instances?
We have a multi-tenant platform in Google App-Engine running on 5+ instances and we want all of our sites to define their own ...