Struggling at Rails beginner help

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:


<%= @message %>

Last Summer, I travelled through Europe on a beer tasting extravaganza!

<%= link_to image_tag("europe.jpg"), :height => "25%", :width => "25%", :controller => "beers", :action => "beer1", %>

[ Click the frothy beverage above ... ]


Below is the view for “beers1” method.


<%= link_to image_tag "cerna.jpg", :height => "25%", :width => "25%", :controller => "beers", :action => "beers2" %>

<%= @message1 %>

[ Click the image to see more beer ]


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!

On 19 November 2012 18:17, Joz P. [email protected] 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

+1 on Colin’s response

On Mon, Nov 19, 2012 at 10:17 AM, Joz P. [email protected]
wrote:

So I’ve just dipped into Rails and I’m completely lost …

<%= @message %>

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 S. ------------------------ [email protected]
http://about.me/hassanschroeder
twitter: @hassan

try railsforzombies

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs