Forum: Ruby on Rails rails image link with javascript ...

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3320715fa6264e6309503d5bd089fad2?d=identicon&s=25 Mufaddal Khumri (mkhumri)
on 2006-01-14 00:34
(Received via mailing list)
Is there a rails rhtml / tag to do something like this:

<a href='/search_action'><img src='/images/button-on.gif' border='0'
onmouseover='this.src="/images/button-on.gif"'
onmouseout='this.src="/images/button-on.gif"'
alt='Button'></a>

Any ideas?

Thanks,
Bc80625db60e9db4394c51d6c1892b49?d=identicon&s=25 Derrick Spell (Guest)
on 2006-01-14 00:49
(Received via mailing list)
Are the images necessary for this rollover?  Have you considered
using CSS to achieve this effect?

-Derrick
3320715fa6264e6309503d5bd089fad2?d=identicon&s=25 Mufaddal Khumri (mkhumri)
on 2006-01-14 01:01
(Received via mailing list)
Unfortunately, yes .. require the rollovers using the images.
Any ideas?
3320715fa6264e6309503d5bd089fad2?d=identicon&s=25 Mufaddal Khumri (mkhumri)
on 2006-01-14 01:35
(Received via mailing list)
I have 2 layouts xyz.rhtml and abc.rhtml. I have some common code in
common.rhtml.

I want to render common.rhtml in both xyz.rhtml and abc.rhtml.

Que 1. What is the best way in ror to do this?

Should I do the following in xyz.rhtml and abc.rhtml:
        <div>
            <%= render(:file => "common.rhtml", :use_full_path =>
true)%>
        </div>

Que 2. If answer to above question is yes, then is my usage is correct?
(Note: All three files are in app/views/layouts)

Currently when I do the above I get the following error:


  ActionView::ActionViewError in Tracking#search_order

Showing /app/views/layouts/xyz.rhtml/ where line *#20* raised:

|No rhtml, rxml, or delegate template found for common.rhtml|

Extracted source (around line *#20*):

|17: 			</div>
18: 		</div>
19: 		<div>
20: 			<%= render(:file => "common.rhtml")%>
21: 		</div>
|

Thanks,
5681bad75e33c70e5bd6c3ab45c19943?d=identicon&s=25 James Earl (Guest)
on 2006-01-14 02:02
(Received via mailing list)
On 1/13/06, Mufaddal Khumri <mkhumri@allegromedical.com> wrote:
>        </div>
>
>
> Thanks,

You might also try render_partial('/common'), where common.rhtml is
moved to app/views/_common.rhtml

James
This topic is locked and can not be replied to.