On Martes, 18 de Enero de 2011 13:05:42 thoen escribió:
> Volker/Sergio -
> 
> Thank you for your replies. Could you elaborate a bit more on what you
> mean by "say that active_scaffold_session_storage (or
> active_scaffold_constraints) is a helper_method in your controller?"

Add in the controller:
helper_method :active_scaffold_session_storage

Or use active_scaffold_constraints adding:
helper_method :active_scaffold_constraints
and replacing active_scaffold_session_storage[:constraints] with 
active_scaffold_constraints in the helper method.

> 
> For now, I have done the following, which eliminates the field
> entirely, instead of placing it as a hidden field:
> 
>   def set_form_fields
>     if active_scaffold_session_storage[:constraints] and
> active_scaffold_session_storage[:constraints][:group_type] and
>       (active_scaffold_session_storage[:constraints][:group_type] ==
> 'School' or
>       active_scaffold_session_storage[:constraints][:group_type] ==
> 'Grade' or
>       active_scaffold_session_storage[:constraints][:group_type] ==
> 'Classroom')
>       active_scaffold_config.create.columns =
> [:subject, :body, :send_to]
>     else
>       active_scaffold_config.create.columns = [:subject, :body]
>     end
> 
>   end
> 
> On Jan 17, 6:31 am, "Sergio Cambra .:: entreCables S.L. ::."
> 
> <[email protected]> wrote:
> > On Lunes, 17 de Enero de 2011 08:50:33 vhochstein escribió:
> > > Hi,
> > > 
> > > one option would be to say that active_scaffold_session_storage is a
> > > helper_method in your controller.
> > 
> > Although I would use active_scaffold_constraints method instead of
> > active_scaffold_session_storage
> > 
> > > --
> > > Volker
> > > 
> > > On Jan 13, 6:08 pm, thoen <[email protected]> wrote:
> > > > I use embed an AS table for Messages in several other views (classes,
> > > > grades, etc). I have a field that needs to display as a select tag in
> > > > most of the embeds but as a hidden field in some of them. I tried the
> > > > following,
> > > > 
> > > >   def send_to_form_column(record, name)
> > > >    if active_scaffold_session_storage[:constraints] and
> > > > active_scaffold_session_storage[:constraints][:group_type] and
> > > >       (active_scaffold_session_storage[:constraints][:group_type] ==
> > > > 'School' or
> > > > active_scaffold_session_storage[:constraints][:group_type] ==
> > > > 'Grade' or
> > > >         active_scaffold_session_storage[:constraints][:group_type] ==
> > > > 'Classroom')
> > > >         select_tag(name, options_for_select(["All", "Only Parents"],
> > > > record.send_to))
> > > >     else
> > > >       hidden_field_tag(name, "All")
> > > >     end
> > > >   end
> > > > 
> > > > but I get an 'undefined local variable or method, not surprisingly,
> > > > on active_scaffold_session_storage. Is there a way to access this
> > > > information from within a form override helper method?
> > > > 
> > > > Best,
> > > > Tom
> > 
> > --
> > Sergio Cambra .:: entreCables S.L. ::.
> > Mariana Pineda 23, 50.018 Zaragoza
> > T) 902 021 404 F) 976 52 98 07 E) [email protected]

-- 
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en.

Reply via email to