similar to: Ajax, RJS, and Standard Form Errors

Displaying 20 results from an estimated 3000 matches similar to: "Ajax, RJS, and Standard Form Errors"

2006 Mar 23
4
RJS and Form Validation (Best Practice)
Hello All ! I''ve been using RJS extensively, but haven''t done any form validation with it until now. Should I be manually passing the RJS template some models error messages from the controller.... or ... should I be using error_messages_for in order to do the display ? I''ve implemented the first approach, but it seems like quite a hack. Any insight would be greatly
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
2006 Jul 16
6
How to access element attributes using RJS?
For example, in the following block: page.select(''.foo'').each do |element| ... end How would I access, just for example, the id attribute of each element in the collection? I''ve randomly tried element.id and element.attributes[''id''], but neither of those has worked. I''ve also been unsuccessful in finding any documentation on this, but it
2006 Apr 05
23
how to create RJS visual effects callbacks
I''m trying desperately to get visuall effects callbacks working in rjs templates to no avail What I''m trying to do is fade an image, change the div with the image to a new image, and then fade the new image back in. How would I go about this in RJS Here''s a simple line from my rjs that I can''t get to work. It is not using callbacks so the
2005 Dec 19
1
Preserving fallback with RJS
Hi guys, I really like RJS. I think they''ll replace partials in alot of instances. Unfortunately, because they''re automatically used like .rhtml and .rxml and are hard to specifically specify it makes it messy to preserve fallbacks when using them. For instance, using partials instead of rjs, my create method might look like: def create post = Post.new(params[:post]) ...
2006 Apr 22
3
rjs woes, any hints?
I''ve pared my rjs experiment down to what seems a bare minimum. When I click on my link_to_remote, the rjs executes, returns the correct javascript to the browser, but it doesn''t update the div I''ve specified. What appears to be coming back from the controller is: Element.update("my_form", "hello, rjs"); I''m tearing my hair out.
2006 Mar 31
3
RJS templates outputting bloated code?
I''m an RJS newbie. I just did the tutorial at http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates, and then used wget to look at the output the RJS template generates. This is what I got: try { new Insertion.Bottom("list", "<li>Fox</li>"); new Effect.Highlight("list",{duration:1}); Element.update("header", "RJS
2006 Apr 21
3
rjs in multiple ajax page
Sorry for the long explanation but I''m having trouble integrating rjs into my form page. Here''s my page: <div id="posts"> <ul id="post_list"><%= render :partial => ''list_results'', :collection => @posts %></ul> <p><%= link_to_remote(''+'', :url => {:action =>
2006 Jul 29
0
RJS templates, Safari 1.3
Hello, I''m having a problem getting RJS templates working with Safari 1.3 (latest version available to OS X 10.3 and earlier). I''m using Rails 1.1.4, running on either linux or OS X.. same results. My RJS pages work fine using Safari 2.0, IE and Firefox.. just not Safari 1.3. The twist is that the following RJS sites work fine in Safari 1.3: http://depot.iamjp.com/demo
2006 Jan 13
1
Rendering an RJS template within another RJS template
Is there a way to render an RJS template within another? I''ve put my simplified code below. No errors are generated, but the partial isn''t rendered. I also tried using render :action => ''update_actions'' destroy.rjs--- page.visual_effect :fade, comment_container(@object.id.to_s) # update the number of comments(below is another rjs template) render :partial
2005 Dec 28
1
RJS and :loading
Hi, I''m a newbie with Ajax and RJS and have one basic question. When contents in .rjs are exceuted in a Ajax sequence? .rjs seems a kind of alternate for .rhtml view file, so I guess they are in action after the controller action completed. The contents of .rjs file are :complete scenario, right? if so, can''t I write some on :loading action in .rjs? like disabling
2006 Apr 22
0
RJS question - Query DOM/CSS from RJS?
I understand that I wouldn''t be able to directly query into the DOM/CSS of a page from within an RJS file because it runs on the server but is there any way to populate a variable from the controller or something to gain access to DOM information? What I want to do is this: I have some RJS to blind_down an error message panel, but if the form is resubmitted and there are still errors,
2006 Aug 02
0
"RJS Error: TypeError: $(element) has no properties"
i have lots of divs, which are added via link_to_remote. now i want to delete them with a link_to_remote button for each. i am giving them ids with the same name and a serialized number. when trying to access them with javascript/rjs, strange things happen: "RJS Error: TypeError: $(element) has no properties?. is this a rails, rjs or prototype bug? or am i missing something? see my code
2006 May 12
0
RJS questions
Hi! 1. Is it possible to execute rjs from onclick event? 2. Can i use rails code inside rjs? So i could easily add complicated form elements like date_select etc? 3. If i have a form_remote_tag which calls action ''add_entry'', do i have to somehow run render method to run rjs file or just create add_entry.rjs file and it will be executed automatically? 4. Can i use rjs code
2006 May 17
0
RJS referring to window.parent
Hi all, I''ve been doing some work on the Ajax Scaffold (http://www.ajaxscaffold.com/), to make it work with file uploads (more specifically, the file_upload plugin). The first logical step was to get rid of form_remote_tag, since it''s impossible to send files via XMLHTTPRequests (to my best knowledge). So I referred to the iframe hack, similar to the upload progress bar here
2007 Feb 08
1
RJS throwing 'rubycode' exception
All, In an RJS template, how could I pass ruby variables values to the javascript without getting the RJS Exception: rubycode? This is what I''m doing (as an example) and is throwing the exception: index.rjs ========= names = ["ruby", "ajax"] page << "alert(#{names})" You think that wouldn''t work because its an array, right? Ok, so if I
2006 Jun 17
2
RJS templates - newbie
I am trying to test drive RJS templates in Rails 1.2. Here is what I did: create table categories (name varchar(255) ); rails RJSTest cd RJSTest rake update_javascripts script/generate controller home index add script/generate model category Note: When I did a rake update_javascripts, I did not see any output. I configured database.yml to talk to mysql. Next I wrote
2006 May 04
1
Ajas Scaffolding and RJS Templates the same thing?
Hey all, I''m just starting in rails and am working on my first app. I need to do inline editing for 2-15 rows of data on a page. I found Ajax Scaffolding here: http://www.ajaxscaffold.com/ And it is EXACTLY what I want in my app. But I''ve also been trying to read a bit up on RJS Templates. Are they basically the same things except RJS is built into rails or is the
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
2006 May 02
1
Very simple RJS not working in IE
My HTML: <div id="search_div" style="display: none;"> <table> <tbody id=''search_results''> </tbody> </table> </div> My RJS: page.insert_html :bottom, ''search_results'', "<tr><td>Test</td></tr>" page.show "search_div" Now, everytime this gets called, it adds a