On Jueves, 4 de Noviembre de 2010 13:27:15 Dan Candea escribió:
> On 11/04/2010 01:07 PM, Sergio Cambra .:: entreCables S.L. ::. wrote:
> > On Jueves, 4 de Noviembre de 2010 11:42:26 Dan Candea escribió:
> >> On 04.11.2010 12:13, Sergio Cambra .:: entreCables S.L. ::. wrote:
> >>> On Jueves, 4 de Noviembre de 2010 11:05:15 Dan Candea escribió:
> >>>> On 11/04/2010 11:55 AM, Sergio Cambra .:: entreCables S.L. ::. wrote:
> >>>>> This method return nil if record.name is nil and return the value
> >>>>> returned by
> >>>>>
> >>>>> logger.info (i don't know what returns). Change it with this:
> >>>>> def value_form_column(record, input_name)
> >>>>>
> >>>>> column = active_scaffold_config.columns[:value]
> >>>>> id = active_scaffold_input_options(column)[:id]
> >>>>> logger.info "##############################################
> >>>>> #{id}" select_options = record.name ? User::LIST[record.name]
> >>>>> : [] select :record, :value, select_options, :name =>
> >>>>> input_name, :id => id
> >>>>>
> >>>>> end
> >>>>
> >>>> with logger.info I was just trying to see the values for different
> >>>> variables so I can understand were is the problem.
> >>>> now it crashes and I receive
> >>>>
> >>>>
> >>>> ActionView::TemplateError (undefined method `name' for nil:NilClass)
> >>>> on line #7 of
> >>>> vendor/plugins/active_scaffold/frontends/default/views/_form_attribute
> >>>> .h tml .erb: 4:<label for="<%= active_scaffold_input_options(column,
> >>>> scope)[:id] %>"><%= column.label %></label>
> >>>> 5:</dt>
> >>>> 6:<dd>
> >>>> 7:<%= active_scaffold_input_for column, scope %>
> >>>> 8:<% if column.options.is_a?(Hash)&& column.options[:update_column]
> >>>> -%> 9:<%= loading_indicator_tag(:action => :render_field, :id =>
> >>>> params[:id]) %>
> >>>> 10:<% end -%>
> >>>
> >>> Backtrace isn't useful without removing backtrace silencers (uncomment
> >>> last line in config/initializers/backtrace_silencers.rb)
> >>
> >> I attached a file with the backtrace
> >>
> >> thank you
> >
> > The exception is due to value column doesn't exist, there is no value
> > column in active_scaffold_config.columns.
> >
> > Is the column named value? Becuase helper is named valorae_form_column
>
> the actual field is valoare, value is just the example I put in the
> emails, cause the code is more complex that this.
>
> > Are you accessing to UserController directly? Becuase helper override is
> > on another helper. If you are using a subform you will have to use
> > active_scaffold_config_for(User) and pass a scope to
> > active_scaffold_input_options.
>
> yes, it is in a subform. I've put active_scaffold_config_for and now I
> get again the RSJ
> the id is trying to update is $("record_value__users_1288873379924").up
> is this correct?
>
> look how it is created in the browser:
> <select id="record_value" name="record[value]" class=""></select>
Sorry, select tag has another options hash before html options hash, try with
this:
select :record, :valorae, select_options, {}, :name => input_name, :id => id
Probably you will need to pass '[users]' (the scope) to
active_scaffold_input_options in order to get right id, you will have to use a
fixed scope because I think you can't get current scope.
>
> id field does not match, no class
>
> > It's easier to get it working in UserController, without subform, and
> > then modify it to work in a subform.
>
> without subform I don't get RJS error, but nothing happens, the select
> is not updated
> again as above, the id field is like above
--
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.