Thank you both. I took your advice and put this code in a helper as
shown below:
def
render_crud_table(obj,controller_name,columns,search_fields_array,status_array,actions)
render :partial => 'shared/crud_maint_table', :object => obj,
:locals => {:controller_name => controller_name, :columns =>
columns, :search_fields_array => search_fields_array, :status_array =>
status_array, :actions => actions}
end
Here is the call with this method:
= render_crud_table(@users,'users',
['id','username','email','active'],@search_fields_array,
@role_array,'user_actions')
Do me a favor and please look at the views code in the following
application and suggest improvements for writing better HAML code. I
learn best by doing. This code works, but I am not sure if this is
how the HAML ninjas write it.
http://github.com/bruparel/file_manager
Bharat
--
You received this message because you are subscribed to the Google Groups
"Haml" 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/haml?hl=en.