similar to: RJS and remote forms

Displaying 20 results from an estimated 400 matches similar to: "RJS and remote forms"

2010 May 20
0
Compressed values on y-axis in effects plot
Dear colleagues, the code below generated the two effects plots that I have attached. I hope they are not stripped. The original two models are as follows: green_shift_mod=glm(green_shift ~ educ+party_id+educ:party_id, family=binomial, data=x) carbon_tax_mod=glm(carbon_tax ~ educ+party_id+educ:party_id, family=binomial, data=x) Then, I try to plot the effects of party_id by education for
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
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
2006 Jul 03
6
Rjs $("aaa").insertHtml is not a function error
Hi, I''ve searched the list and found that someone had the same problem as me http://lists.rubyonrails.org/pipermail/rails/2006-May/043760.html I''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 ..................
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
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/.
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
2010 May 03
7
rendering images dynamically
Hi, I have a rails application where I respond to a request by fetching image urls from various web api calls and need to display them as they come available. I am able to display all the images once I get them all, but that causes an unacceptable delay for my 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
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
2006 Apr 09
4
Best RJS process for what I''m trying to do...
I just wanted to ping this off the list to get some advice since I''m now pulling my hair out. Thanks in advance for taking any time to look at this. It''s much appreciated. Now, my problem is my RJS is working but it''s not inserting how I want it to insert. I have a partial I''m rendering in my view that looks like this: <ul
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 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 +=
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
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
2006 Jul 14
5
Ideas for AJAX pagination
Hi, I am looking for ideas on how to remove the last item from a paginated page when a new item is inserted, thus leaving only 10 elements on the page. Currently I have a form that inserts with AJAX, but as expected, each post added to the page just increases the number of posts leaving 11 on a page that should only be displaying 10. I have unique ID''s for each post (e.g.
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
5
RJS -- What am I missing?
This is driving me nuts:-) I''ve brought it down to a simplified case where I''m rendering this rjs template: page.insert_html :top, ''cat1'', "<li>Some list item</li>" According to FireBug, this is what I''m actually getting in the browser: try { new Insertion.Top("cat1", "<li>Some list
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 :
2006 Jul 21
1
RJS Failing
This code was working before I created the update_link_list method in the helper below (everything was in the controller). I can successfully create a new link but I get a TypeError when I leave all form fields blank -- I expect to see validation error messages. --- #link_controller.rb: def create link = Link.new(params[:link]) saved = link.save num_links = Link.find(:all).size
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