Hello all,

I am working on Rails 3, and I would like to return a forbidden error
message from a controller.

I had trying something like that:

def my_action
  respond_to do |format|
    format.html { redirect_to(login_path, :warning =>
I18n.t('.forbidden'), :status => :forbidden) }
    format.xml  { render :xml => I18n.t('.forbidden'), :status =>
:forbidden }
  end
end

But it is not want I need, because I don't want to redirect to a
particular page, such as login.  I just want to return a standard 403
error (with raise maybe).  Is that possible?

Thank you for your help.
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to