El Tuesday 24 March 2009 18:24:31 [email protected] escribió:
> Hi
>
> On Rails 2.3.2, I have three linked models :
>
> class Company < ActiveRecord::Base
> has_many :users
> end
>
> class User < ActiveRecord::Base
> belongs_to :company
> has_and_belongs_to_many :roles
> end
>
> class Role < ActiveRecord::Base
> has_and_belongs_to_many :users
> end
>
> I use activescaffold for the 3 models...
>
> * First :
>
> If I go on the User List, I have a column with Company. I can click on
> the Company, but I have the Edit Form... I would like to see the
> Company Information...
>
> I tried to write in the model of the Company :
>
> def authorized_for_update?
> false
> end

config.columns[:company].actions_for_association_links.delete :edit
if you don't want link for create inline, then use:
config.columns[:company].actions_for_association_links = [:show]

It's documented here, with examples:
http://wiki.github.com/activescaffold/active_scaffold/api-column

I'm not sure, but maybe you can define authorized_for_update_company? to false 
in your User model, although it won't be shown in update form in that case.

>
> It works ! I can see the Company information from the User AS ! Bit if
> I go to the Company List, I can't any more update companies..
>
> How to resolve it ?
>
> * Second :
>
> Still in the User List, I have a column Roles. I f I clicked on the
> Roles, I have an error like :
>
> ActionView::TemplateError (undefined method `render_component' for
> #<ActionView::Base:0x6f3e638>) on line #39 of vendor/plugins/
> active_scaffold/frontends/default/views/_nested.rhtml:
>
> I read on the group that we should install the plugin
> 'render_component'. I tried...
> It works, but flash messages doesn't work anymore...
>
> Any suggestions ?
>
> Thanks
>
> Vincent
>
> 


-- 
Sergio Cambra .:: entreCables S.L. ::.
Nicolás Guillén 6, locales 2 y 3. 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to