similar to: BIG JS limit? Using replace_html with partials containing JS

Displaying 20 results from an estimated 100 matches similar to: "BIG JS limit? Using replace_html with partials containing JS"

2005 Dec 18
3
undefined local variable in partial
i can''t get rid of the following error: ActionView::TemplateError (undefined local variable or method `order_line'' for #<#<Class:0xb75b2090>:0xb75b1f28>) on line #13 of app/views/admin/_order_line.rhtml: 10: 11: <tr valign="top"> 12: <td> 13: <div class="olnamebox"><%= h(order_line.name) %></div> 14:
2005 Dec 23
5
Can''t get data from products into @order
I went throught the "agile web developemnt with rails" and Now I''m trying to ''enhance'' the code with some extra options. When I go to admin/shipping I want to include some data from the products table in with the order info listed. I can''t seem to get this to work. in my partial form I''m trying to add this: <td
2010 Sep 15
5
Hide an image in show.html.erb
I have the following "show.html.erb" script, and I get as an output TWO images since I use a method to draw an image. How can I HIDE the RESOURCE image? Thanks. Here is the script: <canvas id="line" height="512" width="512"> </canvas> <p id="notice"><%= notice %></p> <p> <b> Name </b> <%=
2006 Jun 06
3
Invoice and invoice_lines
Hello People, I have a possibly very lame question. I am fairly new to RoR, and I want to make sure I do it "right". I have a model called Invoice, and one called InvoiceLines. Usual story: the table "invoice" has a 1:n relationship with "invoice_lines", which includes invoice_id. Now... the application will have a "new order" button, which will allow
2006 Mar 21
11
Stuck on ActiveRecord
Hi, I''m having great fun developing with Rails but I''ve come to a problem that I can''t quite figure out. I have an Order object that "has_many" order_lines. This works perfectly and I can see all the lines. The OrderLine object has an order_id field as well as product_id and amount. Now ideally I would want to do : order.orderline[0].product.name for
2006 May 02
3
Ordering Results returned by has_many relationship.
Noob Question 31,265,232 if I''m searching on an object, say order, that has many "order_lines" and I want to display order lines by Quantity ( an attribute of the order_lines ) descending how could I do that without having to do a find() with :order, but something like; Order.order_lines.each do |ol| <!-- code to diplay the line --> how can I determine the field
2008 Mar 17
9
Render index view and RJS on load?
Hi, I''ve searched for a while online and been unable to find anything concerning this. I have a controller with an index action, which has an index view. This view renders the index page but also needs to execute some javascript to show some data (using effects) when the page loads. I thought I could just create the view and RJS with the same name and the RJS would be run after the
2006 Aug 07
1
Unable to page.replace_html from rjs
I am having problems updating a div defined in a partial using both Element.update and page.replace_html in an rjs. I can put a link_to_remote in the partial using an :update, and the div updates fine. Does anyone have any idea why this might be happening? In the partial: <div><div> . . <div id="question_<%=question.id%>_error"></div> . (if a
2006 Jul 20
0
page.replace_html = Safar scrollbar bug?
If I replace the content of a div with new content which is too tall for the browser window, I get a scrollbar on the right. -- So far so good. But... If I then replace the content with content which DOES fit inside the browser window, Safari doesn''t remove the scrollbar! If I then resize the window ever so slightly, the scrollbar disappears. -- It ONLY happens in Safari. Has
2006 Jul 26
3
Getting Ajax.Updater or page.replace_html to render js?
Hey guys, I, for the life of me, cannot figure out how to get Ajax.Updater or page.repalce_html to render the javascript in a partial. Upon page loading, the partial gets rendered fine. But when called up to render through an AJAX function something goes wrong. Are you guys getting this error??? -- Posted via http://www.ruby-forum.com/.
2006 Jul 26
0
page.replace_html render(:action => ''other_action'')
I want to be DRY. I have a controller action, component, that renders html. I have another controller action, component_update, that returns RJS: This what I''d like for ''component_update.rjs'': page[params[:scaffold_id]].replace_html render(:action => "component", :layout => false) page[params[:scaffold_id]].visual_effect :highlight But, the render is
2006 May 08
1
replace_html on a select fails on IE and Opera
I am using an rjs file to do a page.replace_html on a select field as follows: @inrhtml = options_from_collection_for_select( @widgets, "id", "name") page.replace_html "type_select", @inrhtml I have it working on firefox and safari but it doesn''t work on IE and opera? My javascript defaults are up-to-date. I would appreciate any help. thx, -hkn --
2006 May 25
2
page.replace_html
This is odd. When I call: page.replace_html ''formdiv'', :partial => ''listing'' from an rjs file it renders stuff like: \n \n \n test \n \n test , NY 12344 \n \n Phone: (999)999-8888 \n\t\t\n\n \n \t\n \t\thttp:// \n \t\n \n \n \n"); } catch (e) { alert(''RJS error:\n\n'' + e.toString());
2006 Apr 07
2
page.replace_html "#{var_containing_id_name}", :partial => ''edit''
The subject line says it all. -- Is there a way to do something like: page.replace_html "#{var_containing_id_name}", :partial => ''edit'' That line of code does not work, but I would like to pass the name of a variable to page.replace_html. This variable would contain the id of the div I want to update. Anyone know if/how I could do that? Thanks! : ) Jason
2006 Apr 07
1
Re: page.replace_html "#{var_containing_id_name}",:partial
On 4/7/06, Chris Hall <christopher.k.hall@gmail.com> wrote: > page.replace @user.id, :partial => "edit_form" Thanks a lot Chris. -- Unfortunately, it didn''t quite work when I tried it that way. However, when I tried it this way: page.replace_html "#{@user.id}", :partial => "edit_form" It worked! Thanks again!! : ) Jason
2008 Dec 31
0
replace_html problem
Hi - trying to update a table with page.replace_html using a partial: The view (index.html.erb): [code=]<div id=''prod_table''> <%= render :partial => ''product'' %> </div>[/code] The partial (_product.html.erb) [code=]<table> <% for product in @products %> <tr> <td><%= product.name %></td>
2008 Mar 12
2
RJS replace_html for all divs with a class
Hi- I want to do a bunch of html_replace ''s for a class of divs, not one single div and I want to replace the content with a partial. I can round them up using page.select, but cannot find something that will easily let me do something like: page.select(div.user).each do |d| d.replace_html render partial => y partial end Any ideas? Thanks, Dino
2006 Jul 21
0
Ajax page.replace_html model validation errors
I have the following setup: A model: that validates using helpers like: validates_presence_of, etc.. A view: called ''new'' which renders a partial The partial: _form which has error_messages_for and a form_remote_tag , submit_tag and end_form_tag An action ''create'': that gets executed via the submit_tag in the _form and which in case it can''t
2006 Jul 24
0
Ajax page.replace_html model validation render partial errors
Hi; I have the following setup: A model: that validates using helpers like: validates_presence_of, etc.. A view: called ''new'' which renders a partial The partial: _form which has error_messages_for and a form_remote_tag , submit_tag and end_form_tag An action ''create'': that gets executed via the submit_tag in the _form and which in case it can''t
2006 Apr 07
6
Multiple view types for a single action?
Is it possible to have more than one kind of view for a specific action, for example an .rhtml and a .rjs file to handle the view for the same action? I suspect not, but this makes me wonder if there a way to call the .rjs file from within the .rhtml so the statements within it get executed? Thanks, Andy