Multiple Scaffold

Hi ALL
I am new to the Rails mechanism and so far what I did some tutorial apps
in ROR. On of those contained a practice of the “Scaffold” utility, And
used the “scaffold” to manage a table in an admin section.
This was quite simple but now “In the real world” My new ROR admin
system should consist of several tables.
I am trying (unsuccessfully) to generate a page that has a side menu
with all the tables that I have in my db. Clicking a table will move the
browser to a scaffold page of that table where the side menu stays.
I have already created the side menu, but the links on each table are
tricky.

Any ideas anyone?
Danny

don’t use scaffolding

link_to “tablename”, table_path

will give you the link and is easy enough to use

Thorsten M. wrote:

don’t use scaffolding

link_to “tablename”, table_path

will give you the link and is easy enough to use

What do you mean by table_path?
The one thins I liked about Scaffolding is that it enables me the
list/add/edit operations. Can it be achieved your way?
Thanks
Dannt

scaffolding is a code generator. all it does is generating
some controllers, actions and html-views
you can easily write those lines of code by hand, using
html-helper functions like link_to in your html.erb files
like:
<%= link_to “tablename”, table_path %>
this calls the link_to helper function and places it’s output
(a li tag) in the html response, sent to the browser

sooner or later you will have to learn that anyway, since
scaffolding covers only the very basic operations you mentioned

So, you need help generating a link??

<%= link_to ‘link_label’, :controller => ‘controller_name’, :action =>
‘method_name’ %>

or, for example, if you had a controller called users_controller.rb
and a ‘list’ action, you can create a link to the ‘list’ page with:

<%= link_to ‘Users’, :controller => ‘users’, :action => ‘list’ %>

link_to Documentation:
http://api.rubyonrails.com/classes/ActionView/Helpers/UrlHelper.html#M000900

On Dec 12, 7:22 am, Danny Y. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs