search for: link_to_funct

Displaying 20 results from an estimated 74 matches for "link_to_funct".

2009 Dec 06
3
link_to_function or button_to_function memory usage
...doing crud operations for contact info for one section. I was using ajax calls to edit and cancel and also to add a contact. I am implementing a button_to_function instead of doing an ajax call to just edit/add/or cancel a contact. I am running into a memory issue using the button_to_function or link_to_function. I have this: <%= link_to_function ''Edit Contact'' do |page| page[:showcontact].replace_html :partial => ''/contacts/ ajaxshoweditcontact'' end %> and the edit page also has this for the cancel: _ajaxshoweditcontact.rhtml. <%= button_to_function...
2006 Aug 08
1
link_to_function
Hello I wonder why this happens: this: <%= link_to_function image_tag("chart_bar.png"), :onclick=>"new Effect.toggle(''bar-project#{project.id}'')" %> outputs this: a href="#" onclick="onclicknew Effect.toggle(''bar-project188''); return false;"><img alt="Chart_...
2006 Apr 18
2
link_to_function onmousedown
Hi, Is there some way to produce an anchor that looks like the following using helpers, or should I just code it in the rhtml like this? <a href="#" onmousedown="javascript:foo(); return false"> Thanks, Brad -- Bradley Mazurek
2006 Mar 18
2
Additional link tag attributes with link_to_function...
...9;'m having a bit of a struggle with link_to_remote. Everything works exactly as I want it, but the problem is that I want to add another attribute to the <a>-tag, namely class="". Long story short, I want specific links to look differently from others, but all of them being link_to_function. Normally, I''d do this with adding a class="foo" to certain links and specifying the look with css, but I''m unsure how to do this with Rails. Currently, I have: <%= link_to_remote("foo", :update => ''some-id'', :...
2006 Apr 21
4
link_to_function with submit
...d everywhere but couldn''t find it. I don''t want a submit_tag or image_submit_tag but a normal link that submits my form. Normally I would do this with a javascript like function sendForm () { document.forms[0].submit(); } but this doesn''t work with form_remote_tag link_to_function( ''Send'' , "sendform();") So the question is: how do I send my ajax form? Thanks in advance Peet -- Posted via http://www.ruby-forum.com/.
2007 Dec 06
0
Stange behaviour with internet explorer
Hi! I''m developing an application with Rails 1.2.6 and I''ve facing a weird problem. In a form, I''m using link_to_function that is aggregating a :partial, the code is as follows: <table> <thead> <tr> <th>Marca</th> <th>Porcentaje</th> <th>Objetivo Mensual</th> <th>Destino</th> </tr> </thead> &l...
2008 Jun 18
7
Object Task at episode 74 of railscasts
Hi. In the episode 74 <http://railscasts.com/episodes/74>, Ryan has a model "project" that can have many "tasks", and he uses link_to_function to dynamically add a field in the form for a new Task. In order to do that he created a helper called add_task_link. The code of the method is: # projects_helper.rb def add_task_link(name) link_to_function name do |page| page.insert_html :bottom, :tasks, :partial => ''task...
2007 Jun 26
3
what is the :or parameter in a submit_tag ?
I read the following tag in teh Beast example <%= submit_tag''Login'', :or => link_to_function(''forgotten password'', "$(''reset-password'').toggle();") %> I understand the link_to_function, but what is this :or parameter used for ? the link doesn''t appear, so it cannot be used... thanks for your lights kad -- Posted via http://w...
2006 Jun 27
4
RJS Form Values
Hi, I have the following code : <%=link_to_function("? | China", update_page{|page| page[''tags_en''].value = "China" page[''tags_ch''].value = "?" }) %> This updates two text fields with the China and ?. However I want to append the values, not replace them. So...
2009 Sep 24
4
Action Controller ::MethodNotAllowed
...{:multipart => true, :id => "event_form"} do |f| -%> <%= render :partial => "form", :locals => {:f => f} %> <%= link_to image_tag("/images/btn-cancel.png", :border => 0), dashboard_path, :style => "float:left;" %> <%= link_to_function image_tag("/images/btn-publish.png", :border => 0), "publish_event($(this));", :style => "padding-right:20px;" %> <%= link_to_function image_tag("/images/btn-preview.png", :border => 0), "preview_event($(this));", :style => &qu...
2010 Jul 02
2
Update multiple fields with onclick
We''ve all seen the checkout forms with Bill To: and Ship To: I''d like to have a button that says "Ship to Bill To:" and if we click it, it copies all the Ship To: fields across such as phone, email, etc. I''ve been looking at link_to_function, is that the right path? I''ve done observe_fields before but that went to a controller action whereas here we could get by just copying params[field_values]. Thanks, David -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" grou...
2007 Dec 20
3
How-to spec this helper method?...
Hey gang, I have this dead-simple method defined in a helper: def add_category_link(name) link_to_function name do |page| page.insert_html :bottom, :categories, :partial => ''category'', :object => Category.new end end Where, and mostly how, would I spec this? I haven''t been able to find how to stub the rjs in a helper spec, so I''d appreciat...
2006 May 13
2
Using RJS in views without ajax
Hi! I can use RJS in views like this (without using ajax): <%=link_to_function("switch fields", update_page do |page| page.insert_html :before, ''date'', date_select(''exhibition'', ''date'') page.remove ''date'' end) %> Is there a way to move this RJS code into a function to separate file? .js f...
2006 Jan 17
6
link_to or helper to generate a javascript:history.back() ?
Hello, There is an link_to option or an helper that generate a link like : <a href="javascript:history.back()">Back</a> Thanks
2008 Aug 24
11
link_to_function check javascript attribute
How could I check the value of an javascript object''s attribute? <div id="new_item_details" style="display:none"></div> <%= link_to_function("Show details...", nil, :id => "show_details") do |page| page.visual_effect(:toggle_blind, :new_item_details) if (page[:new_item_details].style.visibility == "none") <----------------------------------------????? page[:show_det...
2008 Feb 19
1
adding an onclick option to link_to method
...ying to use the rail link_to to open a popup window and then print the popup window at the same time. Is there a way to add another "onclick" option to tell the popup to print? I know how to do this in javascript but not sure how to use the rails help to do it. I also am aware that the link_to_function method is used to call a javascript function. Here''s the code I have to open the popup: <%= link_to icon(''icon_printer'', :alt => ''Print'') + ''Print Cable'', {:controller => ''print_popup'',...
2006 May 03
4
Simple Toggle Question
I''m having trouble with the toggle() function from prototype. Basically I want the element hidden by default, and I can''t seem to do it. My code: The CSS: #furtherinfo { dislplay: none; } The View: <%= link_to_function(''Further Information'', "Element.toggle(''furtherinfo'')") %> <div id="furtherinfo"> <p>Hidden by default, hopefully.</p> </div> It works fine when I don''t have the css, but then it displays #details by...
2006 Mar 02
4
Instance variables in Javascript param
How can I make this work ? <a href="#" onclick="new Effect.Fade(@div_id)"></a> @div_id is an instance variable ? TIA -- Posted via http://www.ruby-forum.com/.
2010 Apr 12
3
$(link).previous("input[type=hidden]") is undefined
...<td class ="name"> commentaires sur la preparation : </ td><td></td><td><%= f.text_field :preparation %></td> <td></td> </tr> <%= f.hidden_field :_destroy %> <tr><td><%= link_to_function "remove", "remove_fields(this)" %></td></tr> </p> and in the appliction.js file I have: function remove_fields(link) { $(link).previous("input[type=hidden]").value = "1"; $(link).up(".treatmentfields").hide(); } --...
2009 Aug 07
2
calling a jQuery function from RJS/onclick
...correctly. Now there''s a link on the page that lets me add more rows and i do this via RJS. Here''s the code. <tr id="empty_item"> <div id="plussign"><%= add_item_link "+" %></div> </tr> def add_item_link(name) link_to_function name do |page| page.insert_html :before, :empty_item, :partial=>''item'', :object => Item.new end end Now this partial ''item'' contains form elements upon which jNice needs to work its magic. How can I call the jNice function after the user clicks...