Adding the controller isn't a work around, it's how you're supposed to 
do it.

Also, look for :form_ui = :select in the wiki pages.

-Mike

Chad wrote:
> I have found two workarounds that seem to work but they aren't ideal.
> The first was to create an OrganizationsController, the second was to
> exclude the :organization column from the "Edit" action.
>
> However, I'd still like to show just a simple drop down box instead of
> the "Replace with New" "Add to existing" looking form that shows up in
> the Edit action.
>
> Thanks for any help.
>
>
>
>
> On Feb 9, 1:04 pm, Chad <[email protected]> wrote:
>   
>> I have a very simple activescaffold list.  Each record has a column
>> that is associated to another model.  The list action works fine, but
>> when I click on the Edit action, I get the error 500 because I do NOT
>> have a specific controller for the associated model.  I have the
>> models (simplified code below), but not an OrganizationController (I
>> am not programming this fully RESTful).
>>
>> How can I get this association to just show a select field for the
>> organization column in Edit mode?
>>
>> Thanks for any help.
>>
>> Models:
>>
>> class User < ActiveRecord::Base
>>   belongs_to :organization
>> end
>>
>> class Organization < ActiveRecord::Base
>>   has_many :users
>> end
>>
>> Error below:
>>
>> ActionView::TemplateError (Could not find ::OrganizationsController
>> or ::OrganizationController) on line #18 of vendor/plugins/
>> active_scaffold/frontends/default/views/_form_association.rhtml:
>> 15: -%>
>> 16: <h5><%= column.label -%> (<%= link_to_visibility_toggle
>> (:default_visible => !column.collapsed) -%>)</h5>
>> 17: <div <%= 'style="display: none;"' if column.collapsed -%>>
>> 18: <%= render :partial => subform_partial_for_column(column), :locals
>> => {:column => column, :parent_record => parent_record, :associated =>
>> associated} %>
>> 19: </div>
>> 20: <% @record = parent_record -%>
>>
>>     vendor/plugins/active_scaffold/lib/active_scaffold/helpers/
>> view_helpers.rb:28:in `active_scaffold_controller_for'
>>     
> >
>   

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