Displaying 20 results from an estimated 20000 matches similar to: "RJS questions"
2007 Apr 04
2
Simple RJS Calls Not Working
I have a simlple view:
<h2>Tags</h2>
<% unless @recipe.tags.empty? %>
<table>
<tbody id="tags">
<%= render :partial=>''tags/tag'', :collection=>@recipe.tags %>
</tbody>
</table>
<% end %>
<% form_remote_tag :url=>tags_path(@recipe) do%>
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 12
0
RJS, Safari, Error - DOM exception 7
I''m having nasty cross-browser headache.
Not new to Rails, but quite new to AJAX/RJS.
My app works perfectly in Firefox, but generates
the error in the subject line in Safari.
Pretty simple circumstance, completely reproducible
in all cases:
Any ideas? Relevant code attached.
Layout:
-------
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC
2006 Mar 31
5
RoR 1.1 RJS problem
I''ve been playing with the new RJS stuff in RoR1.1, and I have to say
that I''m am extremely impressed, NICE! work guys. However, I seem to be
having a bit of a problem. I promise, I''ve googled the hell out of it
and haven''t found an answer.
Set up: Putting together a little proof of concept app. Display a form
(index.rhtml) that just has a button to
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 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 May 15
5
Problem with RJS and/or Prototype.js =>ResponseText is blank
Hi, I''ve got a real head-scratcher. I''ve got a standard Ajax form using
form_remote_tag, which calls a controller action which adds a comment
and then sends back some JS via RJS which updates a few items on the
page.
It did work fine but (and I''ve no idea what has happened) now it
doesn''t. It calls the controller action but gets an empty response back
and
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 Sep 20
2
Rendering a partial from within that partial
I am having trouble rendering a partial called ''names'' through a submit
tag located within that partial. The form data is saving with my current
code. However, the existing data is not loading into the form and the
partial is not being re-rendered upon submission to reveal the changes
to this data.What might I do to fix this?
show.rhtml
<%= javascript_include_tag :defaults
2011 Oct 07
0
will_paginate + RJS error
Hi there!
I need some help, I''m new to rjs + will_paginate and don''t know how
to
solve this problem.
The application apparently is working fine, the partial is rendered
by the javascript, the pagination works fine, but sometimes, when I
hit the next page number or " next >>", it reders the code below.
Im using rails 2.3.8, ruby 1.8.7. and will_paginate 2.3.15
2006 Jun 24
6
Ajax fade effect
I have a list of categories, when I delete one of them, I want that item
to fade and then get removed. So I do the following:
1. home_controller:
def delete
@category = Category.find_by_name(params[:name])
@element_id = @category.name
Category.delete_all(["name = ?", @category.name])
end
2. delete.rjs:
if @element_id
page.visual_effect :fade, @element_id
2006 Jul 21
1
rjs template modifying form_remote_tag
I would like to build a form which uses ajax on the first request, but
on a subsequent request uses the regular form_tag. The reason for
doing this is that I need a file upload in the second request, and so
I can''t use AJAX. I''ve tried using an rjs template to modify the
form_remote_tag''s id (using page.replace ''form_tag_id'', ...), but the
request
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 <<
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 Mar 14
2
rjs woes
i''ve just installed the RJS plugin per cody''s instructiuons and read through
tutorials. I''ve made the necessary changes to my existing code and
everything appears to be working, except that the returned javascript is not
being evaluated...
here''s my setup:
i have a checkbox with an onclick event pointing to a javascript function.
this javascript function does
2009 Apr 20
1
RJS sporadic error message
I have this form that allows a user to enter a username and save it,
assocciating your profile with theirs via an id. A list gets updated and
a partial is displayed. The problem is that when I hit the submit button
to this form to make this all happened I (sometimes, but more often then
not) get an RJS error that reads:
TypeError: Cannot set property ''innerHTML'' of bull.
I hot
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
2008 Mar 14
0
problem with rjs and marker group
Lo there all,
i have a function that builds a bunch of markers to go on a google
map. I would like to update them with rjs.
Here is what i have so far.
def map_main_layout
@zoom = params[:zoom].to_i
@zoom = 14 if params[:zoom].nil?
@map = GMap.new("map_div")
# @map.control_init(:large_map => true, :map_type => true) #
(inserts map control)
# place
2006 Apr 27
7
RJS & Ajax question...
Hi,
I''m trying to convert an older Rails application to use Ajax. I''ve
already moved my edit and show actions so that, instead of displaying as
separate pages, they appear in a <div> on my list view.
However, I have two problems:
1) When the user saves the changes, I want to put all the ajax changes
in an RJS template. However, form_remote_tag :url =>{:action =>
2006 Jun 06
0
Get value from form using rjs, and problem with Safari
Hi,
I have got two forms, the first is a textarea plus a link that activates
some javascript to change the form, the second activates some javascript on
the onchange event which changes it into a textarea form.
This works in Firefox, but not in Safari.
Also, I need the value which is selected. I''ve found an example that gives
the parameter to the javascript, like this:
<input