Thanks again
 
Yes Rails is very concise, but every character has a meaning - you are right []
generally means an index or symbol in an array or hash, () is the argument to a
method and {} encloses a block.
I suspect I will just have to work systematically through every step.
As far as the submit goes - I dont want to have a specific submit button in this
case as it is part of a larger form with various other demographics. I want to
save the current provider in a @session['provider'] variable and only change
this if the select box is changed. 
As far as flashhash goes, I want to be able to enter more than one item in a
session before saving the results. The form is a billing dialog and the user
enters several billed items. These are totalled progressively. When the user is
finished they hit the confirm button and the items are saved. Flash will only
save data until the next method and would not work for this.
I will post the code when I get home next week - hopefully Horst can set up an
SVN repository.
Failing that I might do it myself

R

Quoting kuang oon <[EMAIL PROTECTED]>:

> Hi Richard,
> On 11/01/2007, at 12:52 PM, [EMAIL PROTECTED] wrote:
> 
> >
> > Thanks Kuangie
> > Yes I get the data back from the form in params(:form_name) and  
> > then try to save
> > it in @session in the method referred to by the form ie
> >
> > #in view
> > start_form_tag :controller => "relevant_controller", :action =>  
> > "relevant_method"
> > <select name="select_name">
> > #form code - I use options_for_select in a helper to populate the  
> > options
> > end_from_tag
> >
> > #method
> > @form_hash = params(:select_name) # I cant seem to get this to work at
> params(:select_name) is dodgy - the interpreter will interprete that  
> as a params method call to Object with argument :select_name
> what you really mean is: params[:select_name] which means the value  
> at the key :select_name of  the hash called params
> > # all without using an intermediate variable
> > @session['selection'] = @form_hash[:selection_name]
> 
> For persisting data between actions use flash
> e.g. flash[:error]= "program explodes here"
> flash.keep(:error) will retain the value for the next request cycle
> Note the parentheses aren't square ones.
> >
> > I use @session to keep track of temporary data - this is deleted with
> > reset_session when the data is saved to the DB
> >
> > I still find it hard to grasp the variables and hashes etc in Rails
> > The "syntactic sugar" ie the variability allowed in syntax tends to  
> > blur things
> > a bit
> what syntactic sugar? it is a free world. choose your style , you can  
> surround your arguments with () or choose to ignore parentheses
> Ruby is crisper then smalltalk, fewer lines of code to do more stuff.
> But be careful to differentiate between square and curvy parentheses
> Curly braces are another matter altogether, they are equivalent to a  
> do....end block.
> > I find the API docs a bit short on actual examples and detailed  
> > steps through
> > ther code. Googling may get a result, but often it is on forums  
> > with variable
> > quality code
> >
> >
> >
> > Richard
> 
> Kuang
> 
> 
> _______________________________________________
> Gpcg_talk mailing list
> [email protected]
> http://ozdocit.org/cgi-bin/mailman/listinfo/gpcg_talk
> 


_______________________________________________
Gpcg_talk mailing list
[email protected]
http://ozdocit.org/cgi-bin/mailman/listinfo/gpcg_talk

Reply via email to