Skip to content

Instantly share code, notes, and snippets.

@seivan
Created March 21, 2009 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seivan/82912 to your computer and use it in GitHub Desktop.
Save seivan/82912 to your computer and use it in GitHub Desktop.
#Why can't I have :new there as well? It works when I got the respond_to in def new, but when using before filter, I get
#Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id
before_filter :respond_to_id, :only => [:show, :new, :update]
def respond_to_id
respond_to do |format|
format.html
format.xml { render :xml => @blogpost }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment