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

Halting page with 404, if record is not found, by default #871

Merged
merged 1 commit into from Aug 7, 2012

Conversation

Projects
None yet
3 participants
@kot-begemot

kot-begemot commented Jul 1, 2012

Would be nice to halt the page, if the record not found, in default behavior for padrino-admin.

@DAddYE

This comment has been minimized.

Show comment
Hide comment
@DAddYE

DAddYE Jul 4, 2012

Member

Pretty nice, but generally isn't better have it more dry with some like:

error ActiveRecord::Base::NotFound do
  not_found
end
Member

DAddYE commented Jul 4, 2012

Pretty nice, but generally isn't better have it more dry with some like:

error ActiveRecord::Base::NotFound do
  not_found
end
@futurechimp

This comment has been minimized.

Show comment
Hide comment
@futurechimp

futurechimp Jul 4, 2012

Contributor

I usually do something like this in my app.rb file for a given application:

  error ActiveRecord::RecordNotFound do
    halt 404
    render('errors/404')
  end

Then I just put a view in place to handle the error and it all works out great. Much more DRY than putting a halt in each action.

Contributor

futurechimp commented Jul 4, 2012

I usually do something like this in my app.rb file for a given application:

  error ActiveRecord::RecordNotFound do
    halt 404
    render('errors/404')
  end

Then I just put a view in place to handle the error and it all works out great. Much more DRY than putting a halt in each action.

@kot-begemot

This comment has been minimized.

Show comment
Hide comment
@kot-begemot

kot-begemot Jul 5, 2012

But in that case you are not orm independent...
I guess each orm have different behavior in such situation...

kot-begemot commented Jul 5, 2012

But in that case you are not orm independent...
I guess each orm have different behavior in such situation...

DAddYE added a commit that referenced this pull request Aug 7, 2012

Merge pull request #871 from kot-begemot/master
Halting page with 404, if record is not found, by default

@DAddYE DAddYE merged commit f8b9f02 into padrino:master Aug 7, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment