So I''ve just dipped into Rails and I''m completely lost ... I have a very simple website. There are 2 layouts, application and welcome. The route begins at the welcome layout. The "main" controller is connected to the "welcome" layout, and has one method, so this method''s view gets inserted at the yield block. It inserts an image that when you click it, brings you to a new page. This new page has a new layout "application". The controller "beers" is connected to this layout and has three methods, beers1, beers2, food. Below is the view that gets inserted in "welcome" layout: ************************************************************************** <p align="center"><font size="24"><%= @message %></font></p> <p align="center"><font size="20">Last Summer, I travelled through Europe on a beer tasting extravaganza!</font></p> <p align="center"> <%= link_to image_tag("europe.jpg"), :height => "25%", :width => "25%", :controller => "beers", :action => "beer1", %></p> <p align="center"><font size="8">[ Click the frothy beverage above ... ]</font></p> *************************************************************************** Below is the view for "beers1" method. ************************************************************************** <p align="center"><%= link_to image_tag "cerna.jpg", :height => "25%", :width => "25%", :controller => "beers", :action => "beers2" %></p> <p align="center"><font size="18"><%= @message1 %></font></p> <p align="center"><font size="8">[ Click the image to see more beer ] </font></p> ************************************************************************** I would like also to be able to click on this image and go to another new page. This new page is simply the "application" layout again but with the view "beers2" inserted at the yield block instead... How do I do this? I''ve tried the above but it just won''t work, the page won''t change! -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On 19 November 2012 18:17, Joz Private <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> So I''ve just dipped into Rails and I''m completely lost ...I suggest working through a good tutorial such as railstutorial.org (which is free to use online). This will show you the basics of rails. Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
+1 on Colin''s response On Monday, November 19, 2012 11:17:40 AM UTC-7, Ruby-Forum.com User wrote:> > So I''ve just dipped into Rails and I''m completely lost ... > I have a very simple website. There are 2 layouts, application and > welcome. > > The route begins at the welcome layout. > > The "main" controller is connected to the "welcome" layout, and has one > method, so this method''s view gets inserted at the yield block. It > inserts an image that when you click it, brings you to a new page. This > new page has a new layout "application". The controller "beers" is > connected to this layout and has three methods, beers1, beers2, food. > > > Below is the view that gets inserted in "welcome" layout: > ************************************************************************** > <p align="center"><font size="24"><%= @message %></font></p> > > <p align="center"><font size="20">Last Summer, I travelled through > Europe on a beer tasting extravaganza!</font></p> > > <p align="center"> <%= link_to image_tag("europe.jpg"), :height => > "25%", :width => "25%", :controller => "beers", :action => "beer1", > %></p> > > <p align="center"><font size="8">[ Click the frothy beverage above ... > ]</font></p> > > *************************************************************************** > > > > Below is the view for "beers1" method. > > ************************************************************************** > > <p align="center"><%= link_to image_tag "cerna.jpg", :height => "25%", > :width => "25%", :controller => "beers", :action => "beers2" %></p> > > <p align="center"><font size="18"><%= @message1 %></font></p> > > <p align="center"><font size="8">[ Click the image to see more beer ] > </font></p> > > ************************************************************************** > > > I would like also to be able to click on this image and go to another > new page. This new page is simply the "application" layout again but > with the view "beers2" inserted at the yield block instead... > > How do I do this? > > I''ve tried the above but it just won''t work, the page won''t change! > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/mPLgg1kMCwgJ. For more options, visit https://groups.google.com/groups/opt_out.
On Mon, Nov 19, 2012 at 10:17 AM, Joz Private <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> So I''ve just dipped into Rails and I''m completely lost ...> <p align="center"><font size="24"><%= @message %></font></p>Besides the excellent suggestion to work through a Rails tutorial -- If you intend to do web development, please please please learn to write proper HTML and CSS. If nothing else, a glance at the generated markup via `view source` would show you exactly why your page doesn''t change, and provide an immediate clue how to fix it. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
try railsforzombies On Monday, 19 November 2012 23:47:40 UTC+5:30, Ruby-Forum.com User wrote:> > So I''ve just dipped into Rails and I''m completely lost ... > I have a very simple website. There are 2 layouts, application and > welcome. > > The route begins at the welcome layout. > > The "main" controller is connected to the "welcome" layout, and has one > method, so this method''s view gets inserted at the yield block. It > inserts an image that when you click it, brings you to a new page. This > new page has a new layout "application". The controller "beers" is > connected to this layout and has three methods, beers1, beers2, food. > > > Below is the view that gets inserted in "welcome" layout: > ************************************************************************** > <p align="center"><font size="24"><%= @message %></font></p> > > <p align="center"><font size="20">Last Summer, I travelled through > Europe on a beer tasting extravaganza!</font></p> > > <p align="center"> <%= link_to image_tag("europe.jpg"), :height => > "25%", :width => "25%", :controller => "beers", :action => "beer1", > %></p> > > <p align="center"><font size="8">[ Click the frothy beverage above ... > ]</font></p> > > *************************************************************************** > > > > Below is the view for "beers1" method. > > ************************************************************************** > > <p align="center"><%= link_to image_tag "cerna.jpg", :height => "25%", > :width => "25%", :controller => "beers", :action => "beers2" %></p> > > <p align="center"><font size="18"><%= @message1 %></font></p> > > <p align="center"><font size="8">[ Click the image to see more beer ] > </font></p> > > ************************************************************************** > > > I would like also to be able to click on this image and go to another > new page. This new page is simply the "application" layout again but > with the view "beers2" inserted at the yield block instead... > > How do I do this? > > I''ve tried the above but it just won''t work, the page won''t change! > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/md_JR7wRZ2MJ. For more options, visit https://groups.google.com/groups/opt_out.