Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot hide an action_group of links #2

Open
m0x opened this issue Jul 26, 2011 · 3 comments
Open

cannot hide an action_group of links #2

m0x opened this issue Jul 26, 2011 · 3 comments

Comments

@m0x
Copy link

m0x commented Jul 26, 2011

seems more like a pull request, but since i'm übernoob, my problem may just be caused by stupidity, so ... let's just say it's an issue.
when you use a security_method to hide batch links, the

container is still generated with empty content (ugly). I've been skimming through _action_group.html.erb & action_links.rb in your as fork, and i could not find any way to hide a whole action group. Is it possible ?

By the way, your fork is awesome.

@vhochstein
Copy link
Owner

Yes, that s true that s an issue, but a general issue of activescaffold and not just activescaffoldbatch.

I ve seen that issue already in my apps, but I have nt developed a smart way to fix this, cause it s quite a rare case and I do not think it would be good practice to check all ignore and security methods everytime from a performance view just to fix this rare case...

@m0x
Copy link
Author

m0x commented Jul 27, 2011

ok, thanks for the reply. I just used a (ugly) hack to fix this, which consists in a conditionnal style element in my layout:

<% if can_see_links? %>

<style>div.batch{display:none}</style>

<% end %>

performance is not an issue as my site won't see a lot of traffic.

@vtt
Copy link

vtt commented Dec 25, 2011

You can hide a whole action group by removing it. Use a before filter (see https://github.com/activescaffold/active_scaffold/wiki/Per-Request-Configuration) and add "active_scaffold_config.action_links.collection.delete_group :batch"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants