I don't know if that helps, but if you can somehow link this
after_render with a form override
(https://github.com/activescaffold/active_scaffold/wiki/Form-Overrides
or https://github.com/activescaffold/active_scaffold/wiki/Subform-Overrides),
maybe you can do this.

I was thinking something like triggering the form_override with the
after_render_field and do something that would be like passing a
html_option to the form

config.column[:cost_code].options = {:selected =>
record.sub_contractor.cost_code}

Maybe it's a long shot, but it's all I can think now.
2011/10/15 Cláudio Forain <[email protected]>:
> I think I have little to do with your progress, but it's nice to help
> to brainstorm. Anyway, could you answer me some questions?
>
> The code in the helper I told you to use worked for filtering the
> select box? (even though I know it's not what you want)
>
> Whats the result of yout after_render_field ?
>
> On Sat, Oct 15, 2011 at 1:57 PM, JB <[email protected]> wrote:
>> That makes more sense. This is what I have, but it still doesn't work:
>>
>> class OrdersController < ApplicationController
>>  before_filter :authenticate_user!
>>
>>  active_scaffold :order do |conf|
>>    conf.columns[:sub_contractor].form_ui = :select
>>    conf.columns[:cost_code].form_ui = :select
>>    conf.columns[:sub_contractor].update_column = :cost_code
>>  end
>>
>>  protected
>>
>>  def after_render_field(record, column)
>>    if column.name == :sub_contractor
>>      record.cost_code = record.sub_contractor.cost_code
>>    end
>>  end
>> end
>>
>> Somehow I need to re-render the cost_code select box. I'm making
>> progress though, so thanks.
>>
>> --
>> 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.
>>
>>
>

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