FAQ Database Discussion Community


ActionController::UrlGenerationError in Home#home No route me atches {:action=>“edit”, :controller=>“users”, :id=>nil} missing required keys: [:id]

ruby-on-rails,routing,user,actioncontroller
I get the error: ActionController::UrlGenerationError in Home#home No route matches {:action=>"edit", :controller=>"users", :id=>nil} missing required keys: [:id] in my home controller. When I am sign in, I get errors in the home/home mostly about No route matches...:controller=>"users", :id=>nil} missing required keys: [:id]. For some reason, it looks like the sign_in...

Rails “action” params key conflict

ruby-on-rails,ruby,actioncontroller
I am building a RESTful Rails service with various CRUD endpoints. On one of the Create endpoints, the data I am passing in includes: ... action: "action_name" ... The problem I am having is that params[:action] contains "create", not the actual value of the action parameter I'm passing in. This,...

Rails 4.1 ActionController::UnknownFormat in index method

ruby-on-rails,ruby-on-rails-4,devise,rails-activerecord,actioncontroller
I am a noob. After an exhaustive search of other questions, I was unable to find similar posts with clear and correct answers. First, let me explain that my app has nested associations as follows: User has one customer Customer has many accounts User has many accounts through customer So...

Rewrite Rails response URL

ruby-on-rails,rack,actioncontroller
I saw this. I did params.select!{|k, v| v.present?} which cleans blank params, but I do not know how to make the response URL to be cleaned. I continue getting something like http://localhost:3000/restaurants/search?utf8=%E2%9C%93&city=&cuisine=&number_of_people=&query=hello I am looking for http://localhost:3000/restaurants/search?utf8=%E2%9C%93&query=hello Also, I would delete utf8 param, is that bad? Update I am considering...

Action Controller error. Url Generation error. No route matches

ruby-on-rails,ruby-on-rails-3,actioncontroller
I'm working through the 'Ruby on rails 3 essential training" on lynda.com and am having an issue while generating my server. So far I have a subjects_controller.rb, linked to my views folder, to the file: list.html.erb My error when trying to start the server is: No route matches {:action=>"show", :controller="subjects",...

Heroku-Puma-ActionController:Live not allowing multiple requests

ruby-on-rails,ruby,heroku,actioncontroller,puma
I'm in the process of making a web app using Rails that maps tweets from the Twitter Streaming API onto a mapbox map. It uses Puma as the server and ActionController:Live to create a http connection with the client to push the new tweets. The Twitter Stream is being opened...

Rails, form is calling wrong action

ruby-on-rails,ruby,forms,routing,actioncontroller
I have made my form: <tbody> <% @player.bases.each do |basis| %> <td><%= basis.id %></td> <td><%= image_tag(basis.image_url(:thumb), class: 'thumbnail') %></td> <td><%= link_to basis.name, basis %></td> <td><%= basis.cost %></td> <td><%= basis.short_info %></td> <td> <%= form_for @player, url: {:controller => 'players', :action => :remove_detail} do |f| %> <%= f.hidden_field :type, :value => 'basis'...