similar to: page.insert_html

Displaying 20 results from an estimated 1000 matches similar to: "page.insert_html"

2006 Jun 07
0
using inline insert_html to generate uniquely named elements
Hello all, I?m using some inline rjs to add content with a unique id like so: In the <head>: function add_fields() { html = ''<div id="'' + new Date().getTime() + ''">''; html += "<%= escape_javascript(render :partial => ''field_set'') -%></div>"; new Insertion.After("whatever", html); } In
2008 Apr 23
0
Passing a hidden field to insert_html
I''m trying to pass a hidden field (item_property) to the add_link helper function but when I do it the process threads start eating up memory and my computer freezes. [code=helper.rb] def add_link(name) link_to_function name do |page| page.insert_html :bottom,:partial, :partial => ''item'', :object => Item.new(:item_property => "Some text")
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>
2006 Jul 05
0
Javascript repeating fields.
The one area I keep hitting my head against in Rails is repeating fields via javascript. I frequently have forms where one or more fields are actually broken out into sub tables because there can be multiple simultaneous values. Rails seems to want to you to use the [] construct in the form helpers (e.g. text_field(''employee[]'', ''name'')), but I can''t
2006 May 28
1
RJS template / page.insert_html problem
Hiall, I have a rjs template which is calling page[:xxx].replace_html ... a couple of times and this works perfectly. However, in the same rjs file I have two calls to page.insert_html, which do not work. No error in development.log, nor error message in browser, the new content for the div simply isn''t changed at all. This is my code: ... action = "save_" +
2006 Jul 26
3
insert_html inserting fragment twice
Has anyone had trouble with inline RJS insert_html with the latest version of Rails? My problem is that insert_html inserts the html fragment twice. For example, render :update do |page| page.insert_html :top, "some_list", "<li>booyow</li>" end would render "<li>booyow</li>" twice. Thanks. -- Posted via
2009 Aug 07
2
calling a jQuery function from RJS/onclick
Hi, I have the following jQuery function on the head of my page. <script type="text/javascript"> jQuery.noConflict(); /* calling jNice on document ready */ jQuery(document).ready(function($) { $(''div.jNice'').jNice(); }); ..... </script> On page load, this gets called correctly. Now there''s a link on the page that lets me add more
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 files are not parsed
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
2009 Mar 07
0
RJS: pass javascript variables in ruby calls
Hey, I have this link_to_function which takes an RJS block as follows: page.insert_html :bottom, :documents, :partial => "upload_fields", :locals => { :doc => Document.new, :index => ''UNIQUE_ID'' } It adds a partial to a div. I need index to be a unique id, but can''t generate one. I have an actual javascript function next_index() that will
2006 Mar 22
1
page.insert_html and the :text argument
Hi, I''ve got a problem with .rjs templates. When I do page.insert_html :bottom, ''stylist_tablebox'', :text => "what ever" This is what I get: new Insertion.Bottom(''stylist_tablebox'', null); I tried this on Edge rails revision 3860 in an inline rjs update. Thanks in advance, Frederik
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|
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 I need something like this :
2009 Oct 06
1
Problems Processing multiple form elements generated by javascript actions
Hi all, After many days of struggling, I have a multi-model form with ajax elements more or less working, but I''m hitting a wall with a few bugs that I can''t figure out. Guidance would be very much appreciated. I''m using the Ryan Bates technique from Advanced Rails recipes to dynamically add and remove elements on a multi-model form.
2006 Jun 21
2
Using RJS to highlight one LI if using insert_html on an UL?
It seems common to use RJS for quickly adding and highlighting a list that is having content added to it like this: http://rafb.net/paste/results/Z3m32g48.html ... where "my_list" would be an UL and the partial would insert a LI. Given that example, is there an easy way to highlight only the newly inserted LI instead of the whole UL? The only way I can see to do it is to give
2008 Dec 13
2
What is "The Rails Way" to do this?
I have a PHP application with the following in one of the "views": <input type="button" onClick="newAlt()" value=" + "></nobr> The JavaScript for "newAlt()" is: // using DOM create new input box for alternate part function newAlt() { var html = "<input style=''background-color:#FFFFCC'' "; html +=
2007 Oct 26
2
Appending to a textarea with RJS
Ok, this is driving me nuts. I''m trying to RJS some text into a text_area which may or may not have been written in by the user. if I page.insert_html :before, :after, :top, or :bottom, it either sticks the contents above or below the text box (but never in). If I do: page[:textboxid].value = "blah" it overwrites the contents of the textbox but doesn''t APPEND to it.
2007 Mar 25
5
Insert text into text area field with RJS
Hi, I''d like to insert/append some default text into a text area after clicking on an image button ''test.png'' in edit.rhtml: <%= link_to image_tag("test.png"), url => { :action => :new_text } %> Action: # article_body is the textarea''s id. def new_text render :update do |page| page.insert_html :bottom, :article_body,
2010 Mar 14
2
https question
Hi I have question about https I am using mozila to access gmail as https://mail.google.com/mail Why mozilla prompts me the alert box? "You have requested an encrypted page that contains some unencrypted information. Information that you see or enter on this page could easily be read by a third party." How mozilla knows I have data not encrypted? ls https secured? Thank you Send
2006 Nov 18
2
RJS page.delay timing issues
Hi. Has anyone ran into issues with the timing of page.delay. I have been testing in firefox, for the most part, and it seems that there is no reliability on when the page.delay timings kick in. What happens is that sometimes it will work fine, and the countdown looks great; other times it will just jump to the end and display everything at once, other times it will be jerky. I''m on a