Displaying 20 results from an estimated 200 matches similar to: "RJS Templates and the Replace semantics"
2006 Jan 20
1
Update HTML Element with Ajax
I have following files.
list.rhtml
-----------------------
<ul id="items">
<%= render(:partial => ''item'', :collection => @items) %>
</ul>
_item.rhtml
------------------------
<li id="<%= item.id %>" >
<%= item.name %>
<%= item.body %>
</li>
edit.rjs
------------------------
page.replace_html
2006 Jul 03
1
plugin to add method to rjs "page" object
Hi,
I would like to add a new method to the rjs "page" object through a
plugin. For a simple example, suppose I want to add the following
which is really just an alias for the usual page.replace_html.
def replace_html2(id, *options_for_render)
call ''Element.update'', id, render(*options_for_render)
end
How can I stitch this new method
2009 Jul 07
0
[PATCH server] Update app to work with rails 2.3.2
Note that this does not fix gettext for app,
that will be done separately in another patch
as F10/F11 require different setups for that.
In the meantime gettext works if manually changed
in environment.rb to gettext_rails instead of
gettext/rails
Signed-off-by: Jason Guiditta <jason.guiditt at gmail.com>
---
src/app/controllers/application.rb | 200 --------
2005 Dec 17
17
problems with quotes and escaping
First of all I''d like to say thanks for all the great work everyone has put
into scriptaculous,
I''m having a lot of fun playing with the framework, and easily moving into
Web 2.0 territory.
I''ve just hit a snag on my project though.
So here''s my code:
...
var newEvent=
"<div
2008 Jan 22
3
dynamic table/adding rows in IE using 'new Element("tr")'
I''m trying to create a few menus using prototype.js "insert" function.
I create a table using ''new Element("table")'', insert it in DIV and
then add links - one row per link (or the other way round - create a
full table, then insert it).
I initially wrote a code that worked fine in Firefox, but did not in
IE (currently testing with 6.0):
function
2006 Mar 29
1
Fixing output_compression for Rails 1.1
With Rails 1.1 the output_compression[1] plugin was broken.
Once I upgraded to 1.1, I had to tweak it a bit to make it work.
Mainly it''s removing the code dealing with component requests, as
that''s part of rails now, and changing one function call.
Get the modified output_compression.rb file from
http://devblog.famundo.com/output_compression.rb and give it a try.
It''s
2006 Apr 04
5
How to implement tag clouds using plugin?
The code on
http://blog.craz8.com/articles/2005/10/28/acts_as_taggable-is-a-cool-piece-of-code
is based on the acts_as_taggable gem,anybody has done that using the
acts_as_taggable plugin?thanks!
btw:the code above uses the tag_count method,which is defined in the
gem:
def tags_count(options = {})
options = {:order => ''count DESC''}.merge(options)
2005 Dec 02
0
Resizeable DIVs
I have an implementation of Resizeable DIVs that is based on the
Draggable code from script.aculo.us. This is working for me, but is
only tested on Firefox 1.0.x and IE 6. On IE, the display isn''t great
at small sizes, and the DIV tends to jiggle.
This can work with the element also being Draggable, but there is a
restriction that the Draggable handle must be set, and cannot be the
2006 Jan 08
0
RE: Replacing an html chunk with a different htmlchunk
Actually, I see there are two other prototype calls:
Element.remove(''foo'');
Which does a parentNode.removeChild(), and
Element.update(''foo'', ''some html'');
Which does element.innerHTML = ''some html'', and executes any script that
is in the string you pass in.
-----Original Message-----
From:
2006 Mar 14
2
RJS & Unicode (again)
I have a problem with unicode & RJS. I searched several boards & blogs,
but was not able to find a solution. Let me explain my problem with an
example.
View (test.rhtml):
...
<div id="a_test_div">?????????</div>
...
Output:
?????????
RJS-Template (an_action.rjs):
page.replace_html ''a_test_div'', ''?????????''
Calling
2006 Apr 20
4
JavaScriptGenerator Dead End
Hi All,
I posted earlier about a problem I was having with the various remote
view methods escaping all the javascript in my callbacks. I was quickly
informed that that''s just what they do, and offered some workarounds.
However, in actually working with this, I''m finding that this one little
thing is forcing me to write some REALLY ugly code. Where I thought I
could
2006 Jul 27
3
How do I update a div''s content in the controller?
Without using an RJS, is there a call I can do in the controller? All I
want to do is this statement, but in the controller:
new Effect.toggle(''notifier_nav'',''appear'', {duration:12.0});
Thanks,
Ben Lisbakken
--
Posted via http://www.ruby-forum.com/.
2006 Jan 21
4
acts_as_taggable clouds?
what is the easiest/established way to make a tag cloud using the
acts_as_taggable plugin? any examples would be greatly appreciated!
-A
--
Posted via http://www.ruby-forum.com/.
2006 Nov 23
0
W3C Range specification conceptually flawed?
hi all!
check this one:
<html>
<head>
<title>Range test</title>
</head>
<body>
<div id="myText">FooBarBaz</div>
<script type="text/javascript">
myText = document.getElementById(''myText'').firstChild;
var range1 = document.createRange();
range1.setStart(myText, 3);
range1.setEnd(myText, 6);
var
2004 Jun 21
0
Bookmarklet for searching R documentation
I recently posted a request for a Mozilla search engine plugin for the R
java search applet. Having recieved no response, I pursued this myself and
came up with an alternative. I found a "bookmarklet" that was used to
submit searches to Amazon. I modified the code to submit searches to the R
search engine. I tested the following using Firefox 0.9 on Windows 2000.
Create a
2006 Jan 30
2
DamageControl
Is there anyone on this list running DamageControl on a
Debian or a Windows system ? If so would you care to share
how you accomplished this (details ... it''s all in the
details) ? While I will still work through the problems I
am encountering (it''s a great learning experience) I would
still like to have a working instance of DamageControl to
use in the meantime.
I am
2006 Jun 08
3
RJS wierdness - Content div display js code
Hi,
I have a link_to_remote name ''Show notes'', which calls an action that
uses this RJS template:
page.replace "notes_remote", :partial => "notes/hide_notes_link"
page.insert_html :top, "notes_list", :template => "notes/list"
page.visual_effect :highlight, ''notes_list'', :duration => 3
Works great. The
2006 Apr 07
6
Multiple view types for a single action?
Is it possible to have more than one kind of view for a specific action,
for example an .rhtml and a .rjs file to handle the view for the same
action?
I suspect not, but this makes me wonder if there a way to call the .rjs
file from within the .rhtml so the statements within it get executed?
Thanks,
Andy
2006 Jun 30
6
using rjs
Hi
I am relatively new to ruby on rails. I want to use this javascript
bundle:
http://prototype-window.xilinus.com/index.html
How would I call those functions in an rjs file?
example:
win = new Window(''window_id'', {title: "Sample", top:100, left:350})
win.getContent().innerHTML = "<h1>Hello world !!</h1>";
win.setDestroyOnClose();
2006 Jun 27
4
RJS Form Values
Hi,
I have the following code :
<%=link_to_function("? | China", update_page{|page|
page[''tags_en''].value = "China"
page[''tags_ch''].value = "?" }) %>
This updates two text fields with the China and ?. However I want to
append the values, not replace them. So I need something like this :