Wednesday, April 21, 2010

[Rails] ActionController::RoutingError after using scaffold

Hey there,

I'm new to Ruby and was following a tutorial found here:

http://stackoverflow.com/questions/545951/ruby-on-rails-link-to-syntax

Anyway, I already had my own MySQL database from PHP development so I
decided to try to create a scaffold off of a table 'users'.

I get the following error:
ActionController::RoutingError in Users#index

Showing app/views/users/index.html.erb where line #9 raised:

user_url failed to generate from {:controller=>"users", :action=>"show",
:id=>#<...>}

The issue is coming from this line:
<%= link_to 'Show', user %>

I tried deleting that code and trying this instead:
<%= user["user_id"] %> -- where user_id is a field in the users table
and it printed the user_id

Is this a known scaffold bug in Ruby installs on Windows? How do I go
about fixing it?

Thanks,
Lang
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate