similar to: Starting with RJS - not working

Displaying 20 results from an estimated 7000 matches similar to: "Starting with RJS - not working"

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 Mar 13
3
problem updating mulitple divs with ajax
i''m having some issues updating multiple divs via ajax. perhaps someone can lend some assistance. i''ve got 2 divs: user_list and user_form. when a person clicks the "edit this user" or "add new user" link the user_form div is updated via an ajax call and the form is shown in the user_form div. this form is a remote form. it submits to either the update
2006 Mar 28
5
RJS call from controller issues javascript that doesn''t get evaluated by browser
Hi, I''m on Rails 1.1 and I have a problem wit RJS In my cotroller i have ==>>> def show @contact = Contact.find(params[:id]) render :update do |page| page[:contactInfo].replace_html :partial=>"contactInfo" end end <<<=== And my contactInfo partial looks like this and it''s placed inside a div element ==>>> <table>
2006 May 16
5
Transactions in RoR
Hi, Does anyone knows how to manage transactions in RoR. Thanx
2006 May 11
2
Reuse code
Hi, I have several helper methods that I use on one view . Is there a way to share this methods on several views ? To be more specific in: companies_helper I''ve defined the helper methods that I would like to use in products section. Thanx, Ovidiu
2006 Apr 07
1
Validate_presence_of error in nested object is not displayed
Hi, I have a contact object . This contact has a address object >>Contact class Contact < ActiveRecord::Base has_one :address validates_presence_of :first_name ,:last_name end .>>> Address class Address < ActiveRecord::Base belongs_to :contact validates_presence_of :address end Addres has the following fields ; address, phone, fax, email In the contacts_controller I
2006 Jul 06
2
rjs rails to execute?
I have the following: layout: <%= javascript_include_tag :defaults %> [...] <div id="menu"> <div id="myrandom"></div> <%= render :partial => ''menu'' %> </div> menu partial: <%= link_to_remote "Generate Text", :update => ''myrandom'', :url => { :action =>
2006 Feb 14
2
Inline list editing with RJS: best practices
I wanted to get the community opinion on the best way to use partials and inline list (<li>) editing. I have a very common scenario where a list is rendered: --- index.rhtml --- <ul> <%= render :partial => ''item'', @collection => @items %> </ul> --- _item.rhtml (simplified) --- <li id="item_<%= item.id %>"> <div
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]) ...
2009 Mar 13
1
search for string insider a string
Hi, sorry if it is a too stupid question, but how do I a string search in R: I have a dataframe A with A$test like: test1 bcdtestblabla2.1bla cdtestblablabla3.88blabla and I want to search for string that start with 'dtest' and ends with number and return the location of that substring and the number, so the end result would be: NA NA 3 2.1 2 3.88 I find grep can
2006 Jul 16
3
RJS problem
I have an odd problem while trying to use a simple rjs. _test.rjs : page.alert "test" test.rhtml: <script><%=render_partial(''test'')%></script> When I am attempting to view controller/test the page comes as if it was a text file. So i am actually seeing: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2006 May 16
1
Nice Ruby tutorial for begginers
http://tryruby.hobix.com/
2006 May 05
6
RJS implementation question
Why is RJS so dependant on programatic creation of Javascript? RHTML is a great implementation in that it puts HTML first, and Ruby second. I would have thought RJS would be the same way: a .js with ERb helpers for generating Javascript functions. RJS putting Javascript second means: - I have to learn a whole new set of commands to use Scriptaculous. - Developers have to constantly chase the
2006 Jul 03
2
rjs renders string or partial but not template or action
Hi, I have an rjs file. I only have one controller called called front. I have views called "new_title.rhtml" and "_new_title.rhtml" These work page.replace_html ''title'', ''new title'' page.replace_html ''title'', :partial => ''new_title'' page.replace_html ''title'',
2010 Sep 27
4
Fitting problem
Hi, I have a function that generates a set of data but I am having problems determining the parameters using the nls fitting procedure. #### "MH"<-function(field,diameter,mu=10e-7,sig=0.1,Ms=100,chi=0){ #variables mu, sig, chi, Ms #input: field and diameter #all in CGS rho <- 5 kb <- 1.38e-16 t <- 300 length.d<-length(diameter) length.H<-length(field)
2006 Jun 27
2
Bug in Firebug or in RJS? Or something else?
I''m getting a really strange result using RJS page.replace_html and wonder if anybody knows anything that could help me figure it out. I''m rendering a partial in a loop in edit.rhtml that puts a set of <div>s on the page, each <div> containing a checkbox_tag with an associated observe_field and a text_field_tag also with an associated observe_field. When the
2006 Aug 07
2
.rjs not run unless I manually set the Content-type header
I''ve got this is my controller def destroy @headers[''Content-Type''] = ''text/javascript; charset=utf-8'' end and this in my .rjs file called destroy.rjs page.alert(''test'') page.visual_effect :shrink, ''tip_''+params[:id], :duration => 3 This works, *unless* I uncomment the Content-Type line in the
2006 Apr 07
3
RJS removing content of div, but not div itself
Hi, I''m creating a list of ingredients on a page. When the user clicks the ''Add Ingredient'' button a record gets added to the db and the ingredient gets added to the page. On the page, each record is represented by a <div> with three <span>s inside. One of the <span>s has a link_to_remote to ''delete'' the ingredient. When the link
2006 Jan 29
2
GetText and rjs templates?
hi, is it possible that gettext don''t work with rjs templates? i''ve just tried this simple example blog_controller.rb : class BlogController < ApplicationController def index end def dosomething end end index.rhtml : <html> <head> <%= javascript_include_tag :defaults %> </head> <body> <div id="test">Some text to change
2006 Jun 26
3
RJS Templates with dynamic id names
Due to the use of partials, I''m trying to dynamically generate the ids being affected in an rjs template, but I can''t seem to get the syntax to work. Basically, I need to do the equivalent of this from the .rhtml template: page.show ''mything<%= @thing.id %>'' No joy there. Apparently RJS templates don''t work with embedded ruby. So I tried: