Displaying 20 results from an estimated 20000 matches similar to: "Where do AJAX Callbacks go into RJS templates..."
2005 Dec 31
9
RJS Templates not conducting callbacks
I''ve run across a weird problem with RJS that I''m trying to figure out:
I have an application that was running 0.13.1 that I recently upgraded
to Rails 1.0. I wanted to use RJS templates, so I installed the plugin
and updated my prototype javascript file via ''rake update_prototype.''
I attempted to test the templates out via the following code, but the
AJAX
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 =>
2007 Jan 17
1
AJAX GET requests returning "uninitialized constant Mime::RJS"
Hey all, I thought this was working until recently. I''m using
link_to_remote:
link_to_remote("More info", :url => user_path(user),
:update =>
"show_#{user.id}",
:method => :get) #
NOTE: "GET" request
This then updates a hidden div ("show_123"
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 Feb 08
3
RJS templates before, during and after
RJS templates are nifty. They let you put all sorts of fun effects all
over your bland html pages without too much work.
The link_to_remote function also lets you run scripts before, during,
and after an AJAX call is run by using callbacks.
There does not seem to be an equivalent method for running an RJS
template before or during an action. Rendering it at the end is no problem.
One
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
2009 Jul 28
4
RJS-Template and link_to_remote
Hi, I am quite new to rails and can''t use any rjs-templates.
The problem is, that he can''t use/find the methods in that template
e.g. ''page'' or ''replace_html''. I get an error message on these
methods.
Here''s what I got so far in my example:
Controller:
----
class AjaxTestController < ApplicationController
layout
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 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.
2009 Jul 24
5
padawan seeks advice from jedi masters to create toggle box via ajax/rjs before slitting wrists with ruby powered light-saber.
I AM TRYING TO MAKE A DAMN TOGGLE BOX, BUT USING MY OWN GRAPHIC AND HAVING
THE MOUSECLICK TRIGGER BOTH SWITCHING THE GRAPHIC (via AJAX) AND SAVING THE
STATE IN THE DATABASE.
I GOT IT ALL WORKING WITH NORMAL HTML GET CALLS TO THE SERVER, BUT I NEED IT
TO BE AJAXIFIED SO THAT THE PAGE DOESN''T RELOAD.
AND TO COMPLICATE MATTERS, IT HAS TO WORK IN A TABLE WITH AN ARBITRARY
NUMBER OF ENTRIES,
2006 Feb 08
3
Using shared RJS templates
I''ve got an action in my application controller that needs to call a
shared RJS template. Typically it''s actually being called by subclasses
of the application controller.
I''ve tried this..
def action
...code..
render :partial => "shared/template"
end
with ''_template.rjs'' existing in the shared folder.
The problem that crops
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
2008 Jul 17
2
Problem with link_to_remote, RJS and jRails
Hi, everyone,
I''m trying to update the content of a div using link_to_remote and RJS
template.
Everything works fine if I use the default Prototype/Scriptaculous
libraries, but I want to use jRails ''coz other parts of my application
use a lot of jQuery.
Here are the steps I done:
1. inside StatesController.rb I defined the following action:
def update_view
# do nothing just
2006 Apr 16
11
RJS templates not found
I am running Rails 1.10 and wanted to check out the RJS templates.
Rails doesn''t seem to find them.
I did issue the rake comment update_javascripts and that did not correct
the problem. RJS is part of 1.1 right?
Any ideas?
Thanks.
--
Posted via http://www.ruby-forum.com/.
2006 Aug 07
1
Unable to page.replace_html from rjs
I am having problems updating a div defined in a partial using both
Element.update and page.replace_html in an rjs. I can put a
link_to_remote in the partial using an :update, and the div updates
fine. Does anyone have any idea why this might be happening?
In the partial:
<div><div>
.
.
<div id="question_<%=question.id%>_error"></div>
.
(if a
2008 Mar 19
6
Back button behavior has changed again in Safari 3.1, after doing a dom update via ajax/RJS
GAH!
Here is the firefox behavior, which is perfect:
1) View page 1
2) Update some text by using link_to_remote or remote_form_for, along
with an RJS replace or replace_html
3) Navigate to page 2
4) Hit back
5) Page was cached with dom updates, note that the page is show in the
same state as it was left
Safari 3.0 behavior
1..4) repeat
5) Page reloads, ending up in the state where it was left
2006 Jun 19
1
RJS Templates
I have a page that when a form gets submitted, I use page.insert_html to
stick a div in another div. The problem is, when I want to refernce it
later on, the IDs are not unique. So to get around this, I concatenated
the id of the item to the end of the div name. Which is fine. I did the
same in the RJS template as well, but it''s not finding that div.
I tried it with string
2006 Apr 28
10
Sharing RJS Templates
Hello All,
I''m enjoying the simplicity and power of RJS templates in Rails 1.1, but am
perplexed about sharing them. I have several templates that I would like to
access in various controllers, but if I moved them to
views/shared/whatever.rjs, my app can''t seem to find them. I changed the
name to _whatever.rjs and referenced them as "shared/whatever", but no
luck.
2006 May 23
0
RJS replace adding multiple inputs
Hi,
I have a classic problem. I want to replace a hidden field inside a
form with a hidden field with some value when a link_to_remote is
pressed. In the link''s action rjs, I''m doing the following:
Assume my form has the following field already
<%= hidden_field(''client'', ''company_id'') $>
So I have a bunch of companies in a list with
2006 Aug 14
0
rendering RJS template from view
I''m sure I''m missing something obvious, but I''m stumped.
I have a tabbed nav bar with an associated content area that is used
to display query results. Clicking a tab, rebuilds the nav bar with
that tab now highlited, performs the query and renders the results to
a separate div. I''m using an RJS template which calls
page.replace_html with the various