Ok found it: only after configuration block set is returning real
objects
but without patch only "each" returns them, the rest methods are
working on set of symbols only...
On 10 Gru, 22:06, Kodak <[EMAIL PROTECTED]> wrote:
> I'm trying to customize form but using as much AS functionalities as
> possible.
> I want to render partial for column separately but have problem
> obtaining column object from action_columns collection.
>
> Standard _form.rhtml:
> <ol class="form" <%= 'style="display: none;"' if columns.collapsed -
> %>>
> <% columns.each :for => @record do |column| -%>
> <% if is_subsection? column -%>
> <li class="sub-section">
> <h5><%= column.label %> (<%= link_to_visibility_toggle
> (:default_visible => !column.collapsed) -%>)</h5>
> <%= render :partial => 'form', :locals => { :columns => column }
> %>
> </li>
> <% elsif is_subform? column and !override_form_field?(column) -%>
> <li class="sub-form" id="<%= sub_form_id(:association =>
> column.name) %>">
> <%= render :partial => form_partial_for_column(column), :locals =>
> { :column => column } -%>
> </li>
> <% else -%>
> <li class="form-element <%= 'required' if column.required? %>">
> <%= render :partial => form_partial_for_column(column), :locals =>
> { :column => column } -%>
> </li>
> <% end -%>
> <% end -%>
> </ol>
>
> mine:
> <ol class="form" <%= 'style="display: none;"' if columns.collapsed -
> %>>
> <% columns.each :for => @record do |column| -%>
> <% if is_subsection? column -%>
> <li class="sub-section">
> <h5><%= column.label %> (<%= link_to_visibility_toggle
> (:default_visible => !column.collapsed) -%>)</h5>
> <%= render :partial => 'form', :locals => { :columns => column }
> %>
> </li>
> <% elsif is_subform? column and !override_form_field?(column) -%>
> <li class="sub-form" id="<%= sub_form_id(:association =>
> column.name) %>">
> <%= render :partial => form_partial_for_column(column), :locals =>
> { :column => column } -%>
> </li>
> <% elsif (column.name.to_s =~ /(?:_planned|_real|_fixed)$/) == nil -
> %>
> <li class="form-element <%= 'required' if column.required? %>">
> <%= render :partial => form_partial_for_column(column), :locals =>
> { :column => column } -%>
> </li>
> <% end -%>
> <% end -%>
> <% column = columns.find_by_name(:start_date_planned) -%>
> <li class="form-element <%= 'required' if column.required? %>">
> <%= render :partial => form_partial_for_column(column), :locals =>
> { :column => column } -%>
> <%= c.name %>
> </li>
> </ol>
>
> the problem is:
> ActionView::TemplateError (undefined method `required?'
> for :start_date_planned:Symbol) on line #20 of app/views/jobs/_f
> orm.rhtml:
> 17: <% end -%>
> 18:
> 19: <% column = columns.find_by_name(:start_date_planned) -%>
> 20: <li class="form-element <%= 'required' if column.required? %>">
> 21: <%= render :partial => form_partial_for_column
> (column), :locals => { :column => column } -%>
> 22: <%= c.name %>
> 23: </li>
>
> Why it is not returning column object? any idea?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---