Note that there are some explanatory texts on larger screens.

plurals
  1. PORouting Error No route matches {:action=>"show"
    primarykey
    data
    text
    <p>I only have 2 weeks learning ruby on rails, in my app the users can register their cars, from their profile (code below) the app sent to the registration cars page,</p> <pre><code>&lt;div class="container"&gt; &lt;fieldset&gt; &lt;h1&gt;&lt;%= @user.email %&gt;&lt;/h1&gt; &lt;br&gt; &lt;h2&gt;now you are able to...&lt;/h2&gt; &lt;br&gt; &lt;ul&gt; &lt;li&gt; &lt;strong&gt;new car registration: &lt;/strong&gt; &lt;%= link_to "new car", new_user_car_path(current_user)%&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/fieldset&gt; &lt;/div&gt; </code></pre> <p>it works before but i don't know what i did that now it show this:</p> <pre><code>Routing Error No route matches {:action=&gt;"show", :user_id=&gt;#&lt;User id: 27, email: "armando.santoya@hotmail.com", encrypted_password: "$2a$10$EZtvPWiXgMfUlAqvuvGAzODMaas/y4rGkJPKJtg4PnC6...", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 1, current_sign_in_at: "2012-07-24 19:07:54", last_sign_in_at: "2012-07-24 19:07:54", current_sign_in_ip: "127.0.0.1", last_sign_in_ip: "127.0.0.1", name: nil, created_at: "2012-07-24 19:07:54", updated_at: "2012-07-24 19:07:54"&gt;, :controller=&gt;"cars"} Try running rake routes for more information on available routes. </code></pre> <p>also I put my carsController</p> <pre><code>class CarsController &lt; ApplicationController def new @car = Car.new end def create @car = current_user.Car.new(params[:car]) if @car.save flash[:notice] = "new car created success" #redirect_to current_user, :flash =&gt; { :success =&gt; "car created!" } else #redirect_to new_user_car_path, flash[:notice] = "sorry try again" end end def index @car=Car.all end def show @car = current_user.car.find(params[:id]) #@car = Car.find(params[:id]) #redirect_to @user end end </code></pre> <p>and my routes.rb</p> <pre><code>Estaciones::Application.routes.draw do root :to =&gt; "static_pages#home" match '/contact', :to=&gt;'static_pages#contact' match '/about', :to=&gt;'static_pages#about' devise_for :users resources :users do resources :cars end </code></pre> <p>my rake routes:</p> <pre><code>root / static_pages#home contact /contact(.:format) static_pages#contact about /about(.:format) static_pages#about new_user_session GET /users/sign_in(.:format) devise/sessions#new user_session POST /users/sign_in(.:format) devise/sessions#create destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy user_password POST /users/password(.:format) devise/passwords#create new_user_password GET /users/password/new(.:format) devise/passwords#new edit_user_password GET /users/password/edit(.:format) devise/passwords#edit PUT /users/password(.:format) devise/passwords#update cancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel user_registration POST /users(.:format) devise/registrations#create new_user_registration GET /users/sign_up(.:format) devise/registrations#new edit_user_registration GET /users/edit(.:format) devise/registrations#edit PUT /users(.:format) devise/registrations#update DELETE /users(.:format) devise/registrations#destroy user_cars GET /users/:user_id/cars(.:format) cars#index POST /users/:user_id/cars(.:format) cars#create new_user_car GET /users/:user_id/cars/new(.:format) cars#new edit_user_car GET /users/:user_id/cars/:id/edit(.:format) cars#edit user_car GET /users/:user_id/cars/:id(.:format) cars#show PUT /users/:user_id/cars/:id(.:format) cars#update DELETE /users/:user_id/cars/:id(.:format) cars#destroy users GET /users(.:format) users#index POST /users(.:format) users#create new_user GET /users/new(.:format) users#new edit_user GET /users/:id/edit(.:format) users#edit user GET /users/:id(.:format) users#show PUT /users/:id(.:format) users#update DELETE /users/:id(.:format) users#destroy </code></pre> <p>this is the new.html.erb for new cars</p> <pre><code>&lt;div class="container"&gt; &lt;h2&gt;new car registration&lt;/h2&gt; &lt;%= form_for(:users, :url =&gt; user_car_path(current_user)) do |f| %&gt; &lt;div&gt;&lt;%= f.label :brand %&gt;&lt;br /&gt; &lt;%= f.text_field :brand %&gt;&lt;/div&gt; &lt;div&gt;&lt;%= f.label :color %&gt;&lt;br /&gt; &lt;%= f.text_field :color %&gt;&lt;/div&gt; &lt;div&gt;&lt;%= f.label :model %&gt;&lt;br /&gt; &lt;%= f.text_field :model %&gt;&lt;/div&gt; &lt;div&gt;&lt;%= f.label :year %&gt;&lt;br /&gt; &lt;%= f.text_field :year %&gt;&lt;/div&gt; &lt;div&gt;&lt;%= f.submit "new car",:class =&gt; "btn btn-primary" %&gt;&lt;/div&gt; &lt;% end %&gt; </code></pre> <p></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload