Hello, I need some kind of an autorization for my *_to_remote functions in my application. For example one of the *_to_remote function calls "/pages/welcome" and the page should be updated via page.replace_html or something like that. The thing is that I don''t want users to see that page when they type domain.com/pages/welcome into their browser. My idea was to add a custom header field which is added every time when my applications sends an *_to_remote request. Does anyone know how I could do that? Doesn''t necessarily need to be solved by adding a custom header field. Any suggestions are highly appreciated :) -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 26 Feb 2009, at 12:59, Heinz Strunk wrote:> > Hello, > > I need some kind of an autorization for my *_to_remote functions in my > application. For example one of the *_to_remote function calls > "/pages/welcome" and the page should be updated via > page.replace_html or > something like that. > The thing is that I don''t want users to see that page when they type > domain.com/pages/welcome into their browser. > My idea was to add a custom header field which is added every time > when > my applications sends an *_to_remote request.There already is one :-) The X-Requested-With header gets set ( and the xhr? method in your controller will test for that for you) Fred> > > Does anyone know how I could do that? Doesn''t necessarily need to be > solved by adding a custom header field. Any suggestions are highly > appreciated :) > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Of course! Stupid me, forgot about that. Thanks a heap for reminding! :) -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---