search for: insert_html

Displaying 20 results from an estimated 104 matches for "insert_html".

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>&quot...
2009 May 20
2
prototype.js insert issue
Hi, I am trying to use the following lines in my RJS and have a problem page.insert_html :bottom,:list,"<ul>" #some conditions checks page.insert_html :bottom,:list,"<li>Hello item</li>" #some more code to add <li>s page.insert_html :bottom,:list,"</ul>" The problem I am having is the first line <<page.insert_html :bot...
2006 Apr 05
2
RJS and remote forms
I''ve run into what I think is a browser bug related to using remote_forms pushed in an RJS update. In my controller, I have an action that creates a new model and returns a form for one of its children: def create_party party = Party.create render :update do |page| page.insert_html :top, ''party-list'', :partial => ''party_header'', :locals => { :party => party } page.insert_html :after, "party-#{party.id}", :partial => ''guest_form'', :locals => { :guest => party.guests.build } end end...
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_" + controller.action_name page.insert_html :before, "block_2", form_remote_tag( :url => { :a...
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
2006 Jul 03
6
Rjs $("aaa").insertHtml is not a function error
...#39;'m have in my page a link like this <%= link_to_remote ("Add #{image_tag(''add.png'')}",:url=>{:action=>''addProduct''})%> and in my controller def addProduct .................. render :update do |page| page[:productsTable].insert_html :partial=>"entryProduct" page.visual_effect :highlight,'':productsTable'' end end entryProduct partial is in _entryProduct.rhtml If I use replace_html instead of insert_Html it works fine. I don''t know exactly what I''m doing wrong. The re...
2007 May 07
0
page.insert_html
Hi everyone, In one of the actions i am using page.insert_html, t works fine in IE7 and Mozila. Is does not seem to work in IE6. Anyone aware of such problems... i''m stuck... any help is appreciated; the element i am inserting into is a <td> page.insert_html :after, ''company''+params[:id].to_s, :partial =>"group",...
2006 Apr 19
4
RJS replace_html auto-closing tags
I''m using the following RJS template to spit out a div containing a list of projects: page.replace_html ''results'', ''<div>'' @projects.each do |p| page.insert_html :bottom, ''results'', p.name + "<br/>" end page.insert_html :bottom, ''searchresults'', ''</div>'' page.show ''results'' However, it seems that my first like to insert the <div> tag automatically sticks a...
2008 Sep 22
3
syntax error in RJS
I''m new to Ruby on Rails and came across a problem I could not solve alone. I''ve a pretty simple RJS file that looks like the following: 3.times do page.insert_html :bottom, ''messages'', ''test'' end page.call ''updateMessageWindow'' However this snippet gives a syntax error: ActionView::TemplateError (compile error D:/Eigene Dateien/Programming/Web/AjaxChat/app/views/chat/update.js.rjs:1: syntax error, unexpe...
2006 Nov 18
2
RJS page.delay timing issues
...ge.visual_effect :fade, ''Infoname'', :duration => 0.5 3. page.visual_effect :fade, ''InfoDescription'', :duration => 0.5 4. page.visual_effect :fade, ''InfoButton'', :duratin => 0.5 5. page.delay(1.0) do 6. page.insert_html :top, ''countdown'', ''Info in..'' 7. end 8. page.delay(2.0) do 9. page.insert_html :bottom, ''countdown'', ''3'' 10. end 11. page.delay(2.3) do 12. page.insert_html :bottom, ''countdo...
2006 Jun 07
0
using inline insert_html to generate uniquely named elements
...tml); } In the body: <%= link_to_function ''Add Fields'', update_page{|page| page.call ''add_fields'' } -%> And it works, but I wish there was a more concise way to do it all in the link_to(). Maybe by somehow including the getTime() wrapper bit around a page.insert_html? I haven?t been able to get anything like that to work, though. Any ideas? Thanks in advanced, Doug -- Posted via http://www.ruby-forum.com/.
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") #adding this parameter creates a problem end end[/code] [code=_item.rhtml] ... <%= f.hidden_field :item_property, :index => nil %> <%= f.text_field :item_...
2006 Aug 02
9
RJS not cross browser compatible?
I have an RJS template that does the following page.insert_html :bottom, "some_id", ''<tr id="some_id"><td></td></tr>'' This works just find in safari and firefox. In IE and Opera it doesn''t work so great. Any ideas? Am I doing something wrong here? -- Posted via http://www.ruby-forum.com/...
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
2010 May 03
7
rendering images dynamically
...user. One approach I am trying is, from my controller, set an @image variable, and then pass in a block to the model that retrieves the image urls. In the block, I call In the controller, I have: @query.load_images! do |image| @image = image render :update do |page| page.insert_html :bottom, ''images-div'', :partial => ''images'' end end In my query model, I have: def load_images! &block for(some_loop_that_gets_one_image_at_a_time) do image = get_next_image block.call(image) end end In the _images.html.erb...
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 appreciate any pointers whatsoever.. thanks! bar...
2006 Apr 09
4
Best RJS process for what I''m trying to do...
...ormatting or the delete button like the other items. Whenm I refresh the page, then it looks proper. Here''s my controller add method: def add @name = MealName.create( params[:meal_name] ) @meal_names = MealName.find(:all) @meal_names << @name render :update do |page| page.insert_html :bottom, ''meal_names'', "<li> #{@name.name} </li>" page.visual_effect :highlight, ''meal_names'', :duration => 3 end end I thought I could get around this by doing a @meal_names << @name and that didn''t work. I...
2006 May 08
3
Can you apply effects to elements create in same RJS file?
I am trying to create a new element in a list and highlight it. I am doing the following in my rjs file: page.insert_html :after, ''bananalist_header'', :partial => ''banana'' page.visual_effect :highlight, "banana#{banana.id}", :duration => 1 The first line creates a new element with the id= ''banana3'' say... The second line then tries to highlight th...
2006 Jul 19
3
render :partial inserting new line in RJS
Struggling a bit with rendering a partial in an RJS template. I''m having to feed the javascript directly to the page object as couldn''t find a way to have insert_html work directly on the proxy object returned by select. However, that''s not the problem. The code for doing that is below and it all works fine, except that a new line is being inserted after the partial and before the final single quote, which means the string isn''t terminated...
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 +=