Skip to content

Instantly share code, notes, and snippets.

@esparkman
Created July 26, 2010 05:33
Show Gist options
  • Save esparkman/490217 to your computer and use it in GitHub Desktop.
Save esparkman/490217 to your computer and use it in GitHub Desktop.
<h1>Node Information</h1>
<% @user.nodes.each do |node| %>
<p>
<b>Unique Name:</b>
<%= link_to node.name, user_nodes_path(@user, node) %>
</p>
<p>
<b>API KEY</b>
<%= node.api_key %>
</p>
<p>
<b>Provider:</b>
<%= node.provider %>
</p>
<% end %>
NoMethodError in Users#show
Showing app/views/users/show.html.erb where line #64 raised:
undefined method `user_node_path' for #<ActionView::Base:0x1059e9ed0>
Extracted source (around line #64):
61: <% @user.nodes.each do |node| %>
62: <p>
63: <b>Unique Name:</b>
64: <%= link_to node.name, user_node_path(@user, node) %>
65: </p>
66:
67: <p>
RAILS_ROOT: /Users/esparkman/webapps/rails2/myVps
Application Trace | Framework Trace | Full Trace
<a href="txmt://open?url=file:///Users/esparkman/webapps/rails2/myVps/app/views/users/show.html.erb&amp;line=64&amp;column=1">/Users/esparkman/webapps/rails2/myVps/app/views/users/show.html.erb:64:in `_run_erb_app47views47users47show46html46erb'</a>
<a href="txmt://open?url=file:///Users/esparkman/webapps/rails2/myVps/app/views/users/show.html.erb&amp;line=61&amp;column=1">/Users/esparkman/webapps/rails2/myVps/app/views/users/show.html.erb:61:in `_run_erb_app47views47users47show46html46erb'</a>
Request
Parameters:
None
Show session dump
Response
Headers:
{"Content-Type"=>"text/html",
"Cache-Control"=>"no-cache"}
new_user_session GET /user_session/new(.:format) {:controller=>"user_sessions", :action=>"new"}
edit_user_session GET /user_session/edit(.:format) {:controller=>"user_sessions", :action=>"edit"}
user_session GET /user_session(.:format) {:controller=>"user_sessions", :action=>"show"}
PUT /user_session(.:format) {:controller=>"user_sessions", :action=>"update"}
DELETE /user_session(.:format) {:controller=>"user_sessions", :action=>"destroy"}
POST /user_session(.:format) {:controller=>"user_sessions", :action=>"create"}
root / {:controller=>"user_sessions", :action=>"new"}
new_account GET /account/new(.:format) {:controller=>"users", :action=>"new"}
edit_account GET /account/edit(.:format) {:controller=>"users", :action=>"edit"}
account GET /account(.:format) {:controller=>"users", :action=>"show"}
PUT /account(.:format) {:controller=>"users", :action=>"update"}
DELETE /account(.:format) {:controller=>"users", :action=>"destroy"}
POST /account(.:format) {:controller=>"users", :action=>"create"}
user_nodes GET /users/:user_id/nodes(.:format) {:controller=>"nodes", :action=>"index"}
POST /users/:user_id/nodes(.:format) {:controller=>"nodes", :action=>"create"}
new_user_node GET /users/:user_id/nodes/new(.:format) {:controller=>"nodes", :action=>"new"}
edit_node GET /nodes/:id/edit(.:format) {:controller=>"nodes", :action=>"edit"}
node GET /nodes/:id(.:format) {:controller=>"nodes", :action=>"show"}
PUT /nodes/:id(.:format) {:controller=>"nodes", :action=>"update"}
DELETE /nodes/:id(.:format) {:controller=>"nodes", :action=>"destroy"}
users GET /users(.:format) {:controller=>"users", :action=>"index"}
POST /users(.:format) {:controller=>"users", :action=>"create"}
new_user GET /users/new(.:format) {:controller=>"users", :action=>"new"}
edit_user GET /users/:id/edit(.:format) {:controller=>"users", :action=>"edit"}
user GET /users/:id(.:format) {:controller=>"users", :action=>"show"}
PUT /users/:id(.:format) {:controller=>"users", :action=>"update"}
DELETE /users/:id(.:format) {:controller=>"users", :action=>"destroy"}
password_resets GET /password_resets(.:format) {:controller=>"password_resets", :action=>"index"}
POST /password_resets(.:format) {:controller=>"password_resets", :action=>"create"}
new_password_reset GET /password_resets/new(.:format) {:controller=>"password_resets", :action=>"new"}
edit_password_reset GET /password_resets/:id/edit(.:format) {:controller=>"password_resets", :action=>"edit"}
password_reset GET /password_resets/:id(.:format) {:controller=>"password_resets", :action=>"show"}
PUT /password_resets/:id(.:format) {:controller=>"password_resets", :action=>"update"}
DELETE /password_resets/:id(.:format) {:controller=>"password_resets", :action=>"destroy"}
login /login {:controller=>"user_sessions", :action=>"new"}
logout /logout {:controller=>"user_sessions", :action=>"destroy"}
/:controller/:action/:id
/:controller/:action/:id(.:format)
#map.resources :nodes
map.resource :user_session
map.root :controller => "user_sessions", :action => "new" # optional, this just sets the root route
map.resource :account, :controller => "users"
map.resources :users, :has_many => :nodes, :shallow => true
map.resources :password_resets
map.login "login", :controller => "user_sessions", :action => "new"
map.logout "logout", :controller => "user_sessions", :action => "destroy"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment