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

[1930] Allow IR shorthand for redirection #2001

Merged
merged 1 commit into from
Sep 26, 2013
Merged

[1930] Allow IR shorthand for redirection #2001

merged 1 commit into from
Sep 26, 2013

Conversation

seanlinsley
Copy link
Contributor

For #1930; supersedes #1944

This removes the Inherited Resources overrides we had. Now the shorthand syntax works:

controller do
  # Redirects to index page instead of rendering updated resource
  def update
    update!{ collection_path }
  end
end

@@ -22,7 +22,6 @@
Then /^I should download a CSV file with "([^"]*)" separator for "([^"]*)" containing:$/ do |sep, resource_name, table|
page.response_headers['Content-Type'].should == 'text/csv; charset=utf-8'
csv_filename = "#{resource_name}-#{Time.now.strftime("%Y-%m-%d")}.csv"
page.response_headers['Content-Disposition'].should == %{attachment; filename="#{csv_filename}"}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is the only thing people might have a bone of contention over. Is there a browser that needs this?

@seanlinsley
Copy link
Contributor Author

Hmm. So this code is still needed by Rails 3.0. I propose no longer supporting 3.0 🙉 🙈 🙊

@gregbell
Copy link
Contributor

gregbell commented Apr 4, 2013

The overrides to the IR controller are still required. If we would like to support the shorthand, we need to implement something similar to this: EddM@72b78c0

I'm going to close this PR for now. If @EddM would like to create a PR for the commit, we could do some refactoring and support this feature.

@gregbell gregbell closed this Apr 4, 2013
@seanlinsley
Copy link
Contributor Author

The overrides are only required for Rails 3.0. Hence why I had set the milestone to be the next big release. Now, this seems like something to go in 0.7.0.

@seanlinsley
Copy link
Contributor Author

@gregbell should this really be closed?

@gregbell
Copy link
Contributor

gregbell commented Apr 4, 2013

Good point. Yes, I think this can stay open and be assigned to 0.7.0. I'm love seeing code deleted! :)

Now the shorthand syntax works:
```ruby
controller do
  # Redirects to index page instead of rendering udpated resource
  def update
    update!{ collection_path }
  end
end
```
@coveralls
Copy link

Coverage Status

Coverage increased (+0.25%) when pulling a0a13d3 on Daxter:bugfix/1930-inherited-resources into 40c18cf on gregbell:master.

seanlinsley added a commit that referenced this pull request Sep 26, 2013
[1930] Allow IR shorthand for redirection
@seanlinsley seanlinsley merged commit bf5ae88 into activeadmin:master Sep 26, 2013
@seanlinsley seanlinsley deleted the bugfix/1930-inherited-resources branch September 26, 2013 01:39
@seanlinsley
Copy link
Contributor Author

finally :]

@dchersey
Copy link

Just saw this ... 7 years later. Solved a nagging and persistent problem with all of my AA sites.

It would be AWESOME to see this in the documentation on http://activeadmin.info !

@deivid-rodriguez
Copy link
Member

We're very happy to take a PR documenting this :)

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.

5 participants