How do I remove the "Add Existing" link action with the AS for rails 3?

65 views
Skip to first unread message

Mihai

unread,
Jan 9, 2013, 11:20:57 AM1/9/13
to actives...@googlegroups.com
Hi there,

I need to get rid of the "Add Existing" link action. Before upgrading to Rails 3 supported active scaffold I was doing this by having

def add_existing_authorized?(record = nil)
   false
end

in my controller. But after upgrading to rails 3 supported active scaffold the security method add_existing_authorized? doen't work anymore.
Any idea is welcome.

thanks!

Sergio Cambra

unread,
Jan 10, 2013, 5:42:55 AM1/10/13
to actives...@googlegroups.com
It should work, add existing link is added with this option:
:security_method => :add_existing_authorized?

Are you defining your method below active_scaffold block?

Hernan Astudillo

unread,
Jan 10, 2013, 5:28:42 PM1/10/13
to activescaffold
if you just want to get rid of it, there's an easier and straightforward way:


conf.columns[:your_column].allow_add_existing = false


--
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 actives...@googlegroups.com.
To unsubscribe from this group, send email to activescaffol...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en.


Mihai

unread,
Jan 11, 2013, 7:59:33 PM1/11/13
to actives...@googlegroups.com
Sergio: Yes the method is defined right after the active_scaffold block.

Hernan: I'm talking about the link displayed on the top right of the list.

Sergio Cambra

unread,
Jan 15, 2013, 12:15:33 AM1/15/13
to actives...@googlegroups.com

What version are you using? Some versions had a bug with authorized methods

--
You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group.

To view this discussion on the web visit https://groups.google.com/d/msg/activescaffold/-/AjNua0EI1n0J.

Mihai

unread,
Jan 15, 2013, 12:11:31 PM1/15/13
to actives...@googlegroups.com
I'm using the version 3.2.16. It is this version concerned by the bug?

Sergio Cambra

unread,
Jan 16, 2013, 3:15:26 AM1/16/13
to actives...@googlegroups.com

It's probable, 3.2.17 has some fixes about authorization

To view this discussion on the web visit https://groups.google.com/d/msg/activescaffold/-/vDMgGe5pflkJ.

Reply all
Reply to author
Forward
0 new messages