Great, it's backwards compatible

On Martes, 6 de marzo de 2012 14:42:18 clyfe escribió:
> Is it ok if i name the helper exactly "list_row_class", and have it always
> called in view (no more "respond_to?") ?
> 
> # view_helpers.rb
> def list_row_class(record)
>   class_override_helper =
> 
> :"#{clean_class_name(record.class.name)}_list_row_class"
> 
>   respond_to?(class_override_helper) ? send(class_override_helper, record)
> 
> : ''
> 
> end
> 
> # _list_record.html.erb
> tr_class = cycle("", "even-record") + ' ' + list_row_class(record)
> 
> On Tuesday, March 6, 2012 12:25:29 PM UTC+2, Sergio Cambra wrote:
> > On Martes, 6 de marzo de 2012 01:45:27 clyfe escribió:
> > > Done:
> > https://github.com/activescaffold/active_scaffold/wiki/Look-and-feel-custo
> > mi> 
> > > zation
> > 
> > Great
> > 
> > > PS.Have you seen my pull request?
> > > https://github.com/activescaffold/active_scaffold/pull/143
> > > Could you please give it a thought?
> > 
> > Yes, but I want to keep global method too, as in form overrides which
> > method
> > without class prefix is tried too. And use a helper to clean up view code.

-- 
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