kun niu wrote: > Hi all, > I'm a ROR newbie. I'm writing ROR application on Ubuntu 10.04, ruby > 1.8.7-p249, rails 2.3.5, mongrel 1.1.5. I wrote a controller called > "admin".
Okay, that is nice... > I also defined a function in the corresponding controller > called "show_admin". Not so nice... Rails works the best and the easiest if you adhere to the Rails conventions. You should start with a basic tutorial somewhere and follow it, trying to understand how it all fits. My favorite way to get people started is to tell them to scaffold a basic application, then see what the generator created, and understand how it works. Later, worry about an admin, or namespacing. script/generate scaffold person last_name:string first_name:string (that creates an initial db migration, controller, and views for a person) rake db:migrate (create the table) script/server Now browse to your app, and add a person or two, noting which link you clicked to do what. Now look at the application code AND your log file to see how Rails is wired togehter > But each time I browsed to "http://localhost:3000/ > admins/show_admin". I always get the following error: > No action responded to show. Actions: index, login, logout, and > show_admin > It seemed that ror find my action, But it failed to show the action. No, that's not correct. Unless you updated your routes.rb file and restarted your server, you don't have a 'show_admin' routing. And you shouldn't have one, that very un-Railsy. > On the other hand, it tried to show the "show" action. But I don't > have such an action. I wonder if anyone here can solve my problem. I > searched the internet. I found someone said that it might be related > to the namespacing system. But I can find the detailed description > since it was a google cache. > Thanks for any hints or advice in advance. -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.