Ok it might be easier to show you type of thing I want to do.
class ActionsController < ApplicationController
def index
@actions = CorporateAction.all(:headers => request.headers)
end
def show
@action = CorporateAction.find(params[:id], :headers =>
request.headers)
end
end
Where CorporateAction is an ActiveResource ie
class CorporateAction < ActiveResource::Base
self.site = "http://localhost:3000"
self.format = :json
end
Is this possible or is there another way of doing it?
Tom
On Dec 31 2010, 4:57 pm, Hassan Schroeder <hassan.schroe...@gmail.com>
wrote:
> On Thu, Dec 30, 2010 at 11:58 PM, Tom <tomjmal...@gmail.com> wrote:
> > I am creating a rails app that is a gui wraping a restful web service
> > that uses a websso for authentication. This websso sets a series of
> > headers that I need to pass from the request to the
> > ActiveResource.find methods. As this is stuff like username etc it is
> > going to be different for each request. I can find examples on how to
> > set headers for all requests not just one.
>
> "set" or do you actually mean "get" ?
>
> If you need to *read* headers from a request you should do that in
> your controller; unsurprisingly they're in a 'request.headers' array :-)
>
> HTH,
> --
> Hassan Schroeder ------------------------ hassan.schroe...@gmail.com
> twitter: @hassan
--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment