search for: update_page

Displaying 20 results from an estimated 24 matches for "update_page".

2006 Mar 03
1
rjs isn''t update_page problems
i have a list of, for example, meal_names. Basically, I can submit a name and the name I add shows up in the list.I had this working wehn i created an actual add.rjs template for it. So feeling good about my self, I attempted to move it all to the controller and use some update_page goodness. Now it the ajax middle doesn''t happen. I don''t get any errors but the list doesn''t update unless I refresh the page. I am not on edge rails (since it broke my app) but I am running cody''s RJS plug-in which I believe supports this behavior. Can anyone pr...
2006 Apr 18
4
update_page yields escaped code in callback
Hi All, The subject pretty well describes what I am experiencing. This line in an .rhtml template: <%= link_to_remote menu_item.humanize, {:update => ''section'', :url =>{:controller => menu_item}, :complete => update_page do |page| page.activate_tab("#{menu_item}_tab", ''menu_'') page[''section''].hide page[''section''].visual_effect(''Appear'', ''{queue: \''end\''}'') end }, :id => &quo...
2006 Mar 03
0
re: rjs update_page problems
...f the english language... i have a list of, for example, meal_names. Basically, I can submit a name and the name I add shows up in the list.I had this working when i created an actual add.rjs template for it. So, feeling good about my self, I attempted to move it all to the controller and use some update_page goodness. Now the ajaxy magic doesn''t happen. I don''t get any errors but the list doesn''t update unless I refresh the page. I am not on edge rails (since it broke my app) but I am running cody''s RJS plug-in which I believe supports this behavior. Can anyone provi...
2006 Mar 07
0
Re: rjs isn''t update_page problems (Cody Fauser)
Thank you for the reply Cody. It didn''t work so I''m just going to try edge rails again. Wish me luck! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060307/7e7df8dd/attachment.html
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 : <%=l...
2006 Jan 30
5
a RJS problem/patch
...emplate when :rjs - "@controller.headers[''Content-Type''] ||= ''text/javascript''\n" + + "@controller.headers[''Content-Type''] = ''text/javascript''\n" + "update_page do |page|\n#{template}\nend" end else I haven''t try CVS version of rails yet, but actionpack/lib/action_view/base.rb seems to have same problem. --- base.rb.old 2006-01-31 02:05:28.000000000 +0900 +++ base.rb 2006-01-31 02:05:38.000000000 +0900 @@ -394,10...
2006 Jul 14
4
Help with link_to_remote or javascript generator
Hi all, I''m a relative noob to rails so I apologize in advance for asking such a basic question. I am trying to do multiple AJAX calls using the link_to_remote helper or the JavaScript generator update_page. I have googled and read the docs for both, but can''t seem to figure out exactly what i need to do. Say I have the following html: <div id="div1"></div> <div><a href="somelink" id="link1">Insert text</a></div> When I cl...
2006 Aug 14
2
ajax - layout problem.
Hi guys Here is my problem... Using Ajax to update a div with link_to_remote. Problem is I have a layout defined in my class, so, the div gets the layout when I call the method, how di I tell a method to ingore the layout? Cheers. Pieter. -------------- next part -------------- An HTML attachment was scrubbed... URL:
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 as rjs so it won'&...
2006 Jul 05
0
Javascript repeating fields.
..._of_hire %> <div id="phone_numbers"> <% for @employee_phone_number in @employee.employee_phone_numbers %> <%= render :partial => ''phone_number'' %> <% end %> </div> <%= link_to_function ''add phone number'', update_page { |page| page.insert_html(:after, :phone_numbers, render :partial => ''phone_number'')} %> <input type="sumbit" value="save"/> <% end %> _phone_number.html <% fields_for :employee_phone_number, @employee_phone_number do |f| %> <%= f....
2006 Jun 02
1
Updating html breaks my interface
...) }"} end def album_select_all @albums= Album.find(:all, :order => "title") choices= [[''All'', -1]] choices+= @albums.collect { |l| [l.title, l.id] } select "album", "id", choices, {}, {} end def show_loading_select update_page do |page| page.replace_html "album_select", loading_select end end def loading_select "<select id=\"loading_select\" DISABLED><option>loading...</option></select>" end Thanks, Ryan -- View this message in context: http://www.n...
2006 May 17
4
.rjs templates undesiered output problem
Hello everyone, I am working with rjs templates in rails, and I''m amazed of how simple it is to generate code with ajax, however I''am having some troubles and I can''t seem to find a way to solve''em. Whenever I put some code in the template, let''s say: page.visual_effect :highlight, ''sitio37'', :duration => 3 I get the
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 Apr 20
4
JavaScriptGenerator Dead End
Hi All, I posted earlier about a problem I was having with the various remote view methods escaping all the javascript in my callbacks. I was quickly informed that that''s just what they do, and offered some workarounds. However, in actually working with this, I''m finding that this one little thing is forcing me to write some REALLY ugly code. Where I thought I could
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 Jun 07
0
using inline insert_html to generate uniquely named elements
...39; + new Date().getTime() + ''">''; html += "<%= escape_javascript(render :partial => ''field_set'') -%></div>"; new Insertion.After("whatever", html); } 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? T...
2007 Mar 09
0
link_to_remote with onmouseover event
...on_mover(name, remote_function(options), html_options) end def link_to_function_mover(name, *args, &block) html_options = args.last.is_a?(Hash) ? args.pop : {} function = args[0] || '''' html_options.symbolize_keys! function = update_page(&block) if block_given? content_tag( "a", name, html_options.merge({ :href => html_options[:href] || "javascript:void(0)", :mouseover => (html_options[:onmouseover] ? "# {html_options[:onmouseover]}; "...
2006 Dec 17
0
unterminated string literal
...;/div> Some other elements should insert content here by: <%= content_tag("div" ,"Training",:id => "#{training.date.day}" , :onmouseover => update_daytraining(training)) %> ApplicationHelper has a method like this: def update_daytraining(training) update_page do |page| page.insert_html :bottom, ''daytaining'', "<br>Test:#{training.date}</br>" end end I get now following javascripterror : Error: unterminated string literal } catch (e) { alert(''RJS error: Source Code is: <div onmouseover="t...
2007 Mar 09
0
different mouse event when using link_to_remote
...o_function_mover(name, remote_function(options), html_options) end def link_to_function_mover(name, *args, &block) html_options = args.last.is_a?(Hash) ? args.pop : {} function = args[0] || '''' html_options.symbolize_keys! function = update_page(&block) if block_given? content_tag( "a", name, html_options.merge({ :href => html_options[:href] || "javascript:void(0)", :onmouseover => (html_options[:onmouseover] ? "#{html_options[:onmouseover]}; " : &q...
2011 Jul 23
0
Rendering of Javascript updates with Rails > 2.1
...lib/action_view/ helpers/prototype_helper.rb:577:in `initialize'' from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.12/lib/action_view/ helpers/prototype_helper.rb:1029:in `new'' from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.12/lib/action_view/ helpers/prototype_helper.rb:1029:in `update_page'' from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.12/lib/action_view/ base.rb:274:in `render'' ... I am not a rails intern and have problems to follow the @template variable construction. Has anyone an idea of how to get the code working again with 2.3? Sebastian -- You receive...