Displaying 20 results from an estimated 3000 matches similar to: "Best RJS process for what I''m trying to do..."
2006 Mar 03
1
rjs isn''t update_page problems
i have a list of, for example, meal_names. Basically, I can submit a name
and the name I add shows up in the list.I had this working wehn i created an
actual add.rjs template for it. So feeling good about my self, I attempted
to move it all to the controller and use some update_page goodness. Now it
the ajax middle doesn''t happen. I don''t get any errors but the list
2006 Mar 03
0
re: rjs update_page problems
my apologies for my previous butchery of the english language...
i have a list of, for example, meal_names. Basically, I can submit a name
and the name I add shows up in the list.I had this working when i created an
actual add.rjs template for it. So, feeling good about my self, I attempted
to move it all to the controller and use some update_page goodness. Now the
ajaxy magic doesn''t
2006 Apr 05
2
RJS and remote forms
I''ve run into what I think is a browser bug related to using
remote_forms pushed in an RJS update.
In my controller, I have an action that creates a new model and returns
a form for one of its children:
def create_party
party = Party.create
render :update do |page|
page.insert_html :top, ''party-list'', :partial => ''party_header'',
2006 Apr 19
4
RJS replace_html auto-closing tags
I''m using the following RJS template to spit out a div containing a
list of projects:
page.replace_html ''results'', ''<div>''
@projects.each do |p|
page.insert_html :bottom, ''results'', p.name + "<br/>"
end
page.insert_html :bottom, ''searchresults'', ''</div>''
page.show
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
..................
2008 Sep 22
3
syntax error in RJS
I''m new to Ruby on Rails and came across a problem I could not solve
alone.
I''ve a pretty simple RJS file that looks like the following:
3.times do
page.insert_html :bottom, ''messages'', ''test''
end
page.call ''updateMessageWindow''
However this snippet gives a syntax error:
ActionView::TemplateError (compile error
D:/Eigene
2006 Aug 02
9
RJS not cross browser compatible?
I have an RJS template that does the following
page.insert_html :bottom, "some_id", ''<tr id="some_id"><td></td></tr>''
This works just find in safari and firefox. In IE and Opera it doesn''t
work so great. Any ideas? Am I doing something wrong here?
--
Posted via http://www.ruby-forum.com/.
2006 May 08
3
Can you apply effects to elements create in same RJS file?
I am trying to create a new element in a list and highlight it.
I am doing the following in my rjs file:
page.insert_html :after, ''bananalist_header'', :partial => ''banana''
page.visual_effect :highlight, "banana#{banana.id}", :duration => 1
The first line creates a new element with the id= ''banana3'' say...
The second line then
2006 Jul 19
3
render :partial inserting new line in RJS
Struggling a bit with rendering a partial in an RJS template. I''m having
to feed the javascript directly to the page object as couldn''t find a
way to have insert_html work directly on the proxy object returned by
select.
However, that''s not the problem. The code for doing that is below and it
all works fine, except that a new line is being inserted after the
2006 Jun 27
5
RJS -- What am I missing?
This is driving me nuts:-)
I''ve brought it down to a simplified case where I''m rendering this rjs
template:
page.insert_html :top, ''cat1'', "<li>Some list item</li>"
According to FireBug, this is what I''m actually getting in the browser:
try {
new Insertion.Top("cat1", "<li>Some list
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 :
2009 Aug 07
2
calling a jQuery function from RJS/onclick
Hi,
I have the following jQuery function on the head of my page.
<script type="text/javascript">
jQuery.noConflict();
/* calling jNice on document ready */
jQuery(document).ready(function($)
{
$(''div.jNice'').jNice();
});
.....
</script>
On page load, this gets called correctly.
Now there''s a link on the page that lets me add more
2006 Apr 01
2
Inline RJS in controller
Inline RJS and Controller
Hi guys,
I really like the idea about inline RJS.
I have about 20 rjs files for this 1 controller.
They are small. Just updating and hiding some div''s.
So to move this into my controller would clean up a lot.
It makes sense because you see in the controller what you do.
Question:
1. Any penalties for doing this?
- size of controller increases
- performance
2006 Jul 21
1
RJS Failing
This code was working before I created the update_link_list method in
the helper below (everything was in the controller). I can successfully
create a new link but I get a TypeError when I leave all form fields
blank -- I expect to see validation error messages.
---
#link_controller.rb:
def create
link = Link.new(params[:link])
saved = link.save
num_links = Link.find(:all).size
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
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
2007 Oct 26
2
Appending to a textarea with RJS
Ok, this is driving me nuts. I''m trying to RJS some text into a
text_area which may or may not have been written in by the user. if I
page.insert_html :before, :after, :top, or :bottom, it either sticks
the contents above or below the text box (but never in). If I do:
page[:textboxid].value = "blah"
it overwrites the contents of the textbox but doesn''t APPEND to it.
2006 Jul 18
6
RJS - Insert at top of table?
Quick question regarding RJS and inserting to the top of a table. Here''s
the view I''m working with:
<table id="links-list">
<tr>
<th>Display title</th>
<th>URL</th>
<th>Description</th>
<th>Category</th>
</tr>
<% for link in @links %>
<tr id="link-<%= h link.id
2006 Jun 21
2
Using RJS to highlight one LI if using insert_html on an UL?
It seems common to use RJS for quickly adding and highlighting a list
that is having content added to it like this:
http://rafb.net/paste/results/Z3m32g48.html
... where "my_list" would be an UL and the partial would insert a LI.
Given that example, is there an easy way to highlight only the newly
inserted LI instead of the whole UL? The only way I can see to do it is
to give
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/.