similar to: RJS - Getting and Setting Form Element Values Question

Displaying 20 results from an estimated 4000 matches similar to: "RJS - Getting and Setting Form Element Values Question"

2006 Dec 08
9
How to update partial attributes of a object from a form?
I have a user table, and it has forty columns, including name, gender, address, email, phone... So my @user object will have forty attributes. I divide these attributes into 4 groups... namely ''general info'', ''personal info'', ''contact info''... and I make separate forms to edit these 4 different group attributes. The problem is when I update
2006 Jul 08
1
reversing display order in for?
I am displaying some data on one of my pages by calling a for loop: for comment in @comments and then diplaying it: <%= link_to comment.send(''comment_subject''), :controller =>''comments'' , :action => ''show'', :id => comment, :class => ''comment'' %> Works great, but it displays things from oldest to
2007 Apr 23
3
How to change Date format
Hi all, I am using InstantRails with MySQL-Front. Date is stored in format yyyy-mm-dd in database. I want to retrieve and show date in dd-mm-yyyy in my view.rhtml. How can I change it to dd-mm-yyyy form. Please help me out. Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google
2013 Dec 02
2
creating opus encoder and decoder executable on Windows
Hi all: How do I create opus encoder and decoder executable on Windows using MS Visual Studio 2010? What I'm doing is the following: 1. I downloaded the codebase on my local drive using: $ git clone git://git.opus-codec.org/opus.git 2. Then I go to D:\opus\win32\VS2010 and open the opus.sln using MS Visual Studio 2010. 3. Then I build the solution opus. I get 3 executable at
2006 Jul 31
2
RJS: hide element problem
Hi, I am trying to hide a "intro" text shown to user the first time after he has made a search, in the website with RJS/Prototype "hide". I get the following error: RJS Error: Type Error: element has no properties. The text I would like to hide is in a div called "intro" and in my RJS I tried: - page.hide[:intro] as well as - page.hide ''intro''
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
2007 Feb 15
1
Specs for RJS HTML output NOT containing an element
Hi I have an RJS template that renders a partial to update a page. I just added a parameter to get passed into this partial to eliminate a row in the table it generates, but I can''t find a way to test that the unwanted output is in fact missing. should(_not)_have_tag doesn''t work with RJS, and there''s no should_not_have from assert select. What
2008 Jul 24
1
How to add link_to_remote element with RJS?
Hello, after executing an action, I add an <li> element to an existing list using a RJS template: page.insert_html :bottom, :contributors, "<li id=''contributor.#{@contributor.id}''>#{@contributor.user.name}</li>" but I need to add an image with a link_to_remote as I have in a partial page: <li id="contributor.<%= contributor.id
2006 Aug 14
0
Checking element presence in RJS
I need to test whether an element exists before I do some RJS thing to it. I currently have a small RJS snippet that looks like this: page << "if $(''foo'') {" page[''foo''].visual_effect :appear page << "}" This would make sense: if page[''foo''] page[''foo''].visual_effect :appear
2006 Apr 17
2
Building Dynamic DOM Element IDs for RJS Templates
My element IDs are constructed using the object id. So . . . <div id="foo<%= foo.id %>" > <p><%= link_to_remote "Do Foo", :url =>{:action => "do", :id => foo.id} %> </div> How do, and can I, build that id in the RJS template? Also, can anyone recommend a good Ruby syntax book that would help me out with Rails? I know
2006 Mar 27
7
rjs template ? (how to check for existence of a dom element?
In my rjs template I''m using the following line. page.visual_effect :slideUp, ''comment_error_details'', :duration => 0.5 It works fine if I have created the div with the id="comment_error_details", but if I haven''t created the error yet then my whole rjs template fails. How can I check to see if an element has been created? I could then put
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 Sep 06
2
RJS Javascript oddity - trying to call Element.setStyle
Hi all, I have a really simple web page. Right now, it''s just a button and a square div. What I want to do is to change the background color of the div to red when the button is clicked. My form code looks like this: <%= form_remote_tag :url => {:action => ''color_show''} %> color_show.rjs looks like this: page <<
2011 Sep 14
5
rjs error TypeError: element.getElementsByTagName is not a function in rails 3+jquery
hi, i am using rails 3.0.10 i am trying with sample application for searching data from table and updating my search.html.erb file is <%= form_for (@employee) do |s|% <div id ="search_details"> <%= s.text_field :name%> <%= s.text_field :emp_id, :onfocus => ''sal(document.getElementById(''employee_name'').value);''%>
2006 Jul 31
4
RJS to find an element
I''m trying to implement a remove from cart method based on the examples in the second edition Agile book. I have everything working except for the RJS that removes items from the cart. Ideally what I''d like to do is highlight an element that I am deleting only if there is more than one of that particular item in the cart. If the item deleted is the only of
2005 Dec 15
2
Passing parameters to before_filter methods
I have a method that checks for a given role. I want to write something in my controllers like before_filter :check_roles(''admin'') Which will ensure the current user has the admin role. Is it possible to pass parameters in this way? Ian
2006 Aug 25
3
RJS Error: Element.update is not a function
Hi, I have implemented some RJS code and I have the same exact code in 2 different places. In one place I get the error "Element.update is not a function" and the other place works fine. Any idea why this error is coming? Breaking my head. -Vinod --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on
2005 Mar 23
2
0.11 problems
I''ve upgraded to 0.11 this morning specifically to test out the pagination stuff. When that didn''t work (didn''t recognise the command) I deleted my project and recreated from scratch. So in short rails projectname cd projectname edit config/database.yml (my database is postgres by the way) ruby scripts/generate model Recordtype ruby
2006 Jul 08
1
Ajax, RJS, and Standard Form Errors
Hi all, I''m trying to take the standard scaffold and add a bit for ajax to it. I have a two column page with the list on the left and the right side is reserved for the create/edit actions. On a successful save my rjs executes and updates the list view on the left and returns the right side to a "home" page. However, if one of the model validations fail I use rjs ro
2009 Apr 15
2
HTML help
Hi,guys, HTML help is not right for math formula: For example: I got the following formula in help page of ca.jo in urca package: <p align="center"><i><B>X</B>_t = <B>Pi</B>_1 <B>X</B>_{t-1} + ... + <B>Pi</B>_k <B>X</B>_{t-k} + <B>&mu;</B> + <B>Phi D</B>_t +