Mark Preston wrote:

> 
> I got it to work by changing my method in the mystuff_controller to look 
> like this:
> 
> require 'Mystuff'
> 
> class MystuffController < ApplicationController
> 
>     def index
> 
>        @my =  Mystuff.find( :all)
> 
>     end
>   end
> 
> The only change was to change the name of the method to "index" Seems 
> odd
> 
> Thanks all
> 
> Mark

This seems like a perfect place to run:

ruby script/generate scaffold widget name:string quantity:integer

then take a look at the whole tree of items that the scaffold generator 
creates for you.  There are some nice instructional clues in how rails 
likes to operate in that generated code...
the standard routes (rake routes >routes.lst), controller methods, and 
views show you how rails likes to work:
look at routes.lst...

widgets  GET  /widgets  :controller => "widgets", :action => "index"

listing widgets -> widgets_controller -> index method -> index view,

new_widget  GET  /widgets/new  :controller => "widgets", :action => 
"new"

create a widget -> widgets_controller -> new method -> new view

I scaffold 'proof-of-concept' enhancements all the time in 'co-operative 
design' sessions for users to get a quick look at their new requested 
feature... it doesn't have all the layout finery added (scaffold forms 
are ugly, but they work), but in the dev environment, that's fine. We 
have some very visual thinkers among our users...
-- 
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to