Displaying 20 results from an estimated 9000 matches similar to: "RJS not sent as text/javascript"
2006 Jun 16
2
RJS replaces JavaScript?
Hi All,
I am currently devleoping a Rails application and I need to do following as
part of client side operations,
1. HTML Form validations
2. AJAX
I am currently calling Javascript methods from views of my application; I
heard about RJS(Remote Javascripts) templates; are the replacing Javascript
altogether? can I use RJS for HTML Form validations and AJAX?
What I believe is that with RJS
2008 Nov 22
4
"syntax error, unexpected tIDENTIFIER , expecting kEND" in RJS response
I get a "syntax error, unexpected tIDENTIFIER, expecting kEND" when
the following RJS template is rendered:
page.insert_html :bottom, :requisite_table, :partial =>
"insert_jobrequisite_select", :locals => {:job => @job, :counter =>
@counter}
page.alert("hi")
The same RJS template is rendered without errors as soon as the rjs
file has only one single
2006 Apr 06
4
Using RJS to call custom JavaScript class/method
The announcement for RoR 1.1 shows some nice examples of RJS calls. In
particular I am interested in this one:
# Call the custom JavaScript class/method AddressBook.cancel()
page.address_book.cancel
In trying to develop a "lightbox" style modal form, I have been
successful in saving the form data via AJAX but I can''t seem to close
the "lightbox". I am using 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 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 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
2008 Mar 17
9
Render index view and RJS on load?
Hi,
I''ve searched for a while online and been unable to find anything
concerning this.
I have a controller with an index action, which has an index view.
This view renders the index page but also needs to execute some
javascript to show some data (using effects) when the page loads. I
thought I could just create the view and RJS with the same name and
the RJS would be run after the
2006 Mar 14
7
Starting with RJS - not working
Hi,
I''m trying to work with RJS and folowed Cody Fauser''s tutorial
(http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates)
I''ve started by creating a new rails applications and executing
rake freeze_edge
rake rails:update:javascripts
rake rails:update:scripts
After that I''ve created a controller:
class DtestController < ApplicationController
2006 Jul 20
6
replace_html + javascript
Hi all,
This is my first post to the list, so I hope it gets through and I
don''t do anything wrong :)
Here''s the issue I''m having...
I have an rjs that''s doing:
page.replace_html ''myid'', :partial => ''my_partial''
And in my my_partial I have:
<script type="text/javascript">
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
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 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'',
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 Aug 08
1
RJS in_place_editor Error
http://pastie.caboo.se/7624
It just renders the JavaScript response as text/html rather than it
being quiet.
try {
new Effect.Highlight("h1",{duration:1});
} catch (e) { alert(''RJS error:\n\n'' + e.toString()); alert(''new
Effect.Highlight(\"h1\",{duration:1});''); throw e }
I got this effect when i included an :update in a
2006 Jul 13
5
RJS - bug I think - caching in development mode
I''ve got a page that has a <div> on it which is updated via RJS. If I add/delete from the <div>, advance to the next page, then use the Back button to return, the updates do not appear unless I Refresh the page. This is in development mode where caching is disabled (I checked development.rb to be sure). I''ve tried expiring the page and that doesn''t help.
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 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 18
9
RJS - not working in IE
I searched thru all the postings about RJS, and I didn''t find one person
who complained of problems specific to IE, but that''s what I''ve got.
My environment is:
Rails 1.0 + RJS Plugin
Updated Javascripts to Scriptaculous 1.5.3 (for evalScripts support)
Monkeypatched in_place_editor to support evalScripts
I have just started using RJS, and I have two .rjs templates.
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 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