Ruby on Rails: link_to_remote and rel -


I want a link from a remote to a Reliance tag, because I want to use Facebox with it.

I was working with a regular link ... but I need a remote link to handle the event that the user does not have Javascript enabled.

It does not currently work (except non-JavaScript part)

  & lt;% = link_to_remote "Ask a question", {: url = & gt; ; {: Action = & gt; : Ask_question ,: id = & gt; @container.id.to_s ,: javascript_disabled = & gt; Wrong},: rel = & gt; 'Facebox'} ,: href = & gt; Url_for (: Controller = & gt ;: View ,: Action =>: ask_question ,: id = & gt; @ container.id.to_s,: javascript_disabled = & gt; true)% & gt; You pass in the HTML options (such as  Reliance Energy ) in your code in the third argument, you are passing it in second (i.e. the first hash). Instead try this: 

  & lt;% = link_to_remote ("Ask a question", {: url = & gt; {: verb = & gt;: ask_question ,: id = Gt; @ container.id .to_s ,: javascript_disabled = & gt; false}}, {: href = & gt; url_for (: Controller =>: View ,: action =>: ask_question ,: id = & Gt; @ container.id.to_s,: javascript_disabled = & gt; true) ;: rel => 'face box'})%>  

(As you know, some brackets and curly braces are optional, but here I have included them for clarity, and possibly they will keep them because you have very complex logic here .)


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -