The easiest way, in your Klasses controller:
config.columns[:IA].form_ui = :select
This means that you get a select dropdown for the field. So you can only
choose from what is already created and the "Create New" stuff goes away.
As for the error: In your User model do you have:
has_many :klasses
If not then that's probably what is giving the error.
As an aside: AS and other frameworks use the word "klass" as a
substitute for "class" which is a ruby keyword. This may or may not
cause you a problem at some stage if your model is called Klass.
Regards,
Kerry
Soren Christensen wrote:
> Hi,
>
> I have a list view of a Klasses which has links to various teaches, IA,
> parent reps etc.
> All of those are done as Rail references with belong_to
>
> For the positions that are not filled AS offers "Create New".
>
> There must be a way to control the access level to this create.
>
> Wondering what it is.
>
> If I click it I get an error:
> Processing UsersController#new (for 76.247.187.116 at 2009-08-19
> 15:00:32) [GET] Parameters: {"parent_column"=>"klasses",
> "action"=>"new", "_method"=>"get", "adapter"=>"_list_inline_adapter",
> "controller"=>"users", "parent_id"=>"67", "parent_model"=>"Klass",
> "parent_controller"=>"klass"}
>
> NoMethodError (undefined method `klasses=' for
> #<User:0x2b807b7d58f8>):
>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---