problems with link_to

<script>     ddaccordion.init({     headerclass: "expandable",                 ..... </script

<li class="expandable"><%= link_to "institut", {:controller => "news"} %></li>

i have an accordion navigation and the headers, which should expand on click, should link to my different sites.everything works fine, however, when the link_to method is nested in a tag where my shared css class, which javascript uses do locate my expandable headers, appears, the link doesn't work any longer.

i hope u can help me.

try <%= link_to "institut", :controller => "news" %> <%= link_to "institut", :controller => "news", :action => "xxxx" %> (link to an action) <%= link_to "institut", :controller => "news", :action => "xxxx", :id => params[:id] %> (link to an action, with a specific ID (via the url)

regards svend

Thorsten Mueller wrote:

not with that information.

what does mean doesn't work any longer? the link isn't displayed? it's displayed but does not react to clicks?

yeah. the link is displayed, but doesn't work. if i change the class to any other css class (not used from javascript) everythings just fine. BUT i NEED to work with a shared class in this case.

"when the link_to method is nested in a tag" what tag?

<li class="sharedClass"><%= link_to "institut", {:controller => "news"}</li> ...doesn't work <li><%= link_to "institut", {:controller => "news"}, :class => "sharedClass" %></li> ...doesn't work

<li class="anyOtherClass"><%= link_to "institut", {:controller => "news"}</li> ...works fine <li><%= link_to "institut", {:controller => "news"}, :class => "anyOtherClass" %></li> ...works fine

how does the generated html output look like? are there any links?

yeah. the link is there, but doesn't link to my view

maybe it's just a css problem... who knows?

i'm quite shure, cause i've tested every permutation with several css classes.

try to replace the link_to with a simple <a> tag, that links to "Ruby on Rails — A web-app framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern.; or something othe reliable...

that works but doesn't give me the points, sorry

i hope with this info u r able to help me? thanx so long. claus

now we're missing the one thing: the CSS content for sharedClass

since that's obviously the source of the trouble

yeah. the link is there, but doesn't link to my view

means? the link is there, the href is correct but doesn't work (my guess) the link is there but the href points to nowhere? (can't imagine that, since ling_to is very reliable)

Thorsten Mueller wrote:

now we're missing the one thing: the CSS content for sharedClass

since that's obviously the source of the trouble

here it is:

.expandable {     cursor: pointer;     font-size: 1.5em;     padding-left: 1.5em; }

yeah. the link is there, but doesn't link to my view

means? the link is there, the href is correct but doesn't work (my guess)

--> no.

the link is there but the href points to nowhere? (can't imagine that, since ling_to is very reliable)

--> yeah. the link is there, but doesn't point to my view.

i'm not able to imagine, what could be wrong. damn. thanx again for your help.

DO THIS BRO :

[Option 1] <%= link_to "<li class='sharedClass'>institut</li>", {:controller => "news", :action => "xxx"} %>

[Option 2] <li><%= link_to "institut", {:controller => "news", :action => "xxx"}, "class" => "sharedClass" %></li>

What do you think?

Enjoy, Reinhart http://teapoci.blogspot.com

... thus i've tried everything u wrote me. nothing worked. i think the problem is, what javascript does with this class.

if somebody is interested in my problem:

here s the link of the js source:

<a href="http://stud3.tuwien.ac.at/~e0503876/igw_sketch/javascript/ddaccordion.js&quot;&gt;js code</a>

have a look at the init function on the end of the code. maybe u r able to find something..?

greets claus

heres the working link:

http://stud3.tuwien.ac.at/~e0503876/igw_sketch/javascript/ddaccordion.js