hi all If I add in my code redirect_to :action => ''index'' it redicrects to the index method in the current controller. how can I redirect it to the index.html page ? thanks -- 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 -~----------~----~----~----~------~----~------~--~---
Try redirect_to ''index.html'' Jim Englert http://jim-rants.com/coding-blog/ On Sat, Nov 29, 2008 at 11:24 AM, Pepe Sanchez < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > hi all > > If I add in my code redirect_to :action => ''index'' it redicrects to > the index method in the current controller. > > how can I redirect it to the index.html page ? > > thanks > -- > 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 -~----------~----~----~----~------~----~------~--~---
Thank you for the example, I tied that - redirect_to ''/index.html'' and it worked -- 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 -~----------~----~----~----~------~----~------~--~---
Hi Pepe, You should do the following: redirect_to :controller => "index", :action => ''index'' Good luck, -Conrad Sent from my iPhone On Nov 29, 2008, at 2:11 PM, Pepe Sanchez <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org > wrote:> > > > Thank you for the example, I tied that > > - redirect_to ''/index.html'' > > and it worked > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Pepe, Take a look at the API, you can redirect to an action, URL or plain text. Cheers, Sazima On Nov 29, 2:24 pm, Pepe Sanchez <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> hi all > > If I add in my code redirect_to :action => ''index'' it redicrects to > the index method in the current controller. > > how can I redirect it to the index.html page ? > > thanks > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I''m having a similar problem that none of these solutions will work for. I understand you can redirect to a URL, the problem is - while I''m developing my app I want to redirect to ''http://127.0.0.1:3000'' but after I deploy it I want it to redirect to something like ''http://app.somedomain.com''. Is there a constant similar to ''RAILS_ROOT'' that I can use? -- 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 Mar 22, 2:18 pm, Paul Reitz <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I''m having a similar problem that none of these solutions will work for. > I understand you can redirect to a URL, the problem is - while I''m > developing my app I want to redirect to ''http://127.0.0.1:3000''but > after I deploy it I want it to redirect to something like > ''http://app.somedomain.com''. Is there a constant similar to ''RAILS_ROOT'' > that I can use?is redirect_to ''/'' good enough ? (or are you redirecting to a different domain to the one you received the request on ?) Fred> > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Paul Reitz wrote:> I''m having a similar problem that none of these solutions will work for. > I understand you can redirect to a URL, the problem is - while I''m > developing my app I want to redirect to ''http://127.0.0.1:3000'' but > after I deploy it I want it to redirect to something like > ''http://app.somedomain.com''. Is there a constant similar to ''RAILS_ROOT'' > that I can use?If there is no other way available then you can set your own constant in ./config/environments/development.rb ./config/environments/production.rb ./config/environments/test.rb So, for development.rb and test.rb REDIRECT_HOST = ''http://127.0.0.1:3000'' while in production.rb REDIRECT_HOST = ''http://192.168.215.35:3333'' and in your controllers redirect_to REDIRECT_HOST -- 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 -~----------~----~----~----~------~----~------~--~---