I’m trying to set up my RESTful controllers to allow public reading of
data
only when they are requesting XML. I’m using acts_as_authenticated for
my
authentication, and am basically trying to do something like this:
class MyController < AC
before_filter :login_required do |controller|
true if controller.params[:format] == ‘xml’
end
def index
@models = Model.find(:all)
respond_to do |wants|
wants.html { render :nothing => true }
wants.js { render :partial => 'index' }
wants.xml { render :xml => @models.to_xml }
end
end
end
Should I just make the whole action public or is there a proper way of
doing
this?
Thanks
Jason