Placing images at <div class="images" >

Hi All,

I am using blueprint framework for my UI design.

I have a set of static pages which I have displayed at the correct
location
using <%= yield >.

Now I want to place a image for each of those static pages at a
different
location. say

How can I achieve this in Rails 3.0.

Regards,
Bhasker.

On 19 February 2011 15:31, Bhasker H. [email protected]
wrote:

Hi All,

I am using blueprint framework for my UI design.

I have a set of static pages which I have displayed at the correct location
using <%= yield >.

Now I want to place a image for each of those static pages at a different
location. say

I don’t understand what it is that you do not know how to do. If you
want an image in a div with appropriate class just do

<%= image_tag('your_image.png') %>
or you could put the class on the image itself <%= image_tag( 'your_image.png', :class => 'images' ) %>

Colin

Hi Collin,

I use application.html.erb to do my styling (span-1 to span-24) and
divide
it into various sections. Namely, logo, header1, then col1, Content
area,
col2 then footer.

Now assume, I have 10 pages (all static) which is from menu->submenu.

When I click on menu ->submenu -> item then I want the description to be
displayed in the content area. Which I achieved by doing <%= yield %>.
All
fine.

Now I want image 1 to be in col1 and corresponding content in body when
the
appropriate selection is done. Like that for all 10 selections (which
could
come from submenus).

I am not able to get the correct image and the correspoding content
displayed.

Hope I have explained it better.

Thanks & Warm Regards,

On 19 February 2011 16:38, Bhasker H. [email protected]
wrote:

come from submenus).
I am not able to get the correct image and the correspoding content
displayed.

What html are you trying to generate?

Colin

Hi,

I don’t understand your question.

Actually, I have some text in in text(1…10).html.erb and for each of
these
files I have image(1…10). Whenever I load text(1…10) in content area
I
want to load the image(1…10) in col1 area.

ie. if text1 is in content area then I want image1 in col1 area


if text10 is in content area then I want image10 in col1 area

Regards,

I think what you need is content_for.

http://api.rubyonrails.org/classes/ActionView/Helpers/CaptureHelper.html#method-i-content_for

On Sun, Feb 20, 2011 at 12:38 AM, Bhasker H. <
[email protected]> wrote:

fine.
Thanks & Warm Regards,

location
<%= image_tag( ‘your_image.png’, :class => ‘images’ ) %>
http://groups.google.com/group/rubyonrails-talk?hl=en.

On Sat, Feb 19, 2011 at 10:41 PM, Colin L. [email protected]
wrote:

  ..............
 if text10 is in content area then I want image10 in col1 area

Please don’t top post, it makes it difficult to follow the thread.
Insert your reply in the previous message at the appropriate points.
Thanks

Sorry for topping and thank you for your quick reply.

I have the following lines in my application.html.erb




I have to get the image1 here




<%= yield %>


Now, how do I use yield:content and yield:col1

Warm Regards,

On 19 February 2011 17:02, Bhasker H. [email protected]
wrote:

Hi,
I don’t understand your question.
Actually, I have some text in in text(1…10).html.erb and for each of these
files I have image(1…10). Whenever I load text(1…10) in content area I
want to load the image(1…10) in col1 area.
ie. if text1 is in content area then I want image1 in col1 area


if text10 is in content area then I want image10 in col1 area

Please don’t top post, it makes it difficult to follow the thread.
Insert your reply in the previous message at the appropriate points.
Thanks

I think Jim is probably right, content_for may be what you want, in
conjunction with multiple yield statements
yield :content
yield :col1
or something like that.

Colin

On 19 February 2011 17:22, Bhasker H. [email protected]
wrote:

files I have image(1…10). Whenever I load text(1…10) in content area

<%= yield %>
.......... ........ Now, how do I use yield:content and yield:col1

Did you do a bit of googling and checking the docs?

 <col1>
      <%= yield :col1
 </col1>




<%= yield :content %>

Then in the file you are yielding to

<% content_for :col1 do %>
<%= image_tag … or whatever %>
<% end %>

<% content_for :content do %>
some other stuff
<% end %>

Colin

Jim & Collin,

The link was useful but could not get the yielding part till I saw
Collin’s
mail.

But, my tag name appears and not the image. Will it matter if I have a
background image loaded.

Regards,

Hey Guys,

I got it.

BUT,

Though the image was in images directory, I did
…/…/…/public/images/*.png
it did not work.

Then I gave the absolute path. “/home/…/*.png” it did not work.

Then I just tried image.png " It worked perfectly"

Thank you for your help.

On Sun, Feb 20, 2011 at 5:35 PM, Bhasker H. <

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