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

Dynamic scope names #2018

Merged
merged 1 commit into from
Mar 28, 2013
Merged

Dynamic scope names #2018

merged 1 commit into from
Mar 28, 2013

Conversation

seanlinsley
Copy link
Contributor

With these changes you can specify a proc for the name shown on index pages for scopes.

Using this syntax:

# Assuming you've got a `published_today` scope defined in your model
scope ->{ Date.today.strftime '%A' }, :published_today

You can get something like this:
dynamic_scopes
(Friday and Thursday are dynamically named)

@macfanatic
Copy link
Contributor

+1

1 similar comment
@marcusg
Copy link
Contributor

marcusg commented Mar 27, 2013

👍

You can now pass in a proc as the first argument to a scope and
have that rendered on your index page.
seanlinsley added a commit that referenced this pull request Mar 28, 2013
@seanlinsley seanlinsley merged commit ba6c819 into activeadmin:master Mar 28, 2013
@seanlinsley seanlinsley deleted the feature/dynamic-scope-name branch April 3, 2013 22:58
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

Successfully merging this pull request may close these issues.

3 participants