Displaying 20 results from an estimated 4000 matches similar to: "Problem with combining rails helper and javascript"
2006 Jun 07
0
javascript that remote_function creates
I''m tring to use remote_function instead of writing all the javascript
out, but am having difficulties..
I have this code in a layout:
<body onload="<%= remote_function(:update => ''show_active'', :url =>
{:action => ''show_active_bugs''},
:complete => visual_effect(:blind_down, ''show_active'')) %>">
2005 Oct 11
2
Pushing Javascript Helper to external file.
I have a table and when I mouseover a row I want a pop-up with some
additional information for that specific row (called remotely).
I can do this easily with something along the lines of...
onmouseover="<%= remote_function(:updated => "notediv", :loading => "
Element.show(''note'');", :url => {:action => ''get_note'', :id
2006 Jan 21
3
Passing ruby variable via remote_function (JavaScript)
Hi,
Brand new to this so please excuse anything obvious that I don''t yet
get.
Here''s what I''m trying to do (This is all in a .rhtml file):
As a simple test I create a local variable called ''localVariable'' and
give it the string "Hello" like this;
<% $localVariable = ''Hello'' %>
Next I want to call a function
2006 Jan 17
0
:afterFinish not getting called?
I am attempting to remove an element in the :afterFinish callback of the
"Squish" effect. This is what my call looks like.
<%= link_to_remote ("X",
:url => { :action => "deleteIt",
:id => wc_line.attributes[''id''],
:exercise_id => wc_line.attributes[''exercise_id''] },
2006 Mar 23
1
Rails AJAX question, calling remote_function in a loop
I think I may be missing something here. I have a collection of people
I want to run through. For each person I want to use AJAX to make a
calculation and update the page with the results. First I tried to do
this with just links, which works fine. It looks like this
<% @eligible_players.each do |player| %>
<tr>
<td>
<%= link_to_remote( player.player_name,
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
2006 Jun 06
1
Getting value of form using Ajax (and problems with Safari)
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
2006 Feb 07
4
Dynamic url with javascript? - Help Please
Hi,
I''m trying to call a remote function when a combobox option is selected,
passing as an argument the current value of the combobox (paramenter
"panel_id":
<select id="server_interface_jack_switch_panel"
2007 Oct 23
2
to_json inconsistency?
Hello,
ActiveSupport::JSON::Variable.to_json is the only to_json without an
"options" parameter. Is this intended?
For example, this code in a .rjs
page[@user.dom_id].visual_effect :drop_out, :afterFinish =>
ActiveSupport::JSON::Variable.new("foo")
fails with
ActionView::TemplateError: wrong number of arguments (1 for 0)
On line #7 of
2006 Jul 10
2
inline javascript in partials
When rendering the following partial, the <script> block isn''t getting
rendered at all. Does rails strip this out or is it some limitation of
the browser?
<% remote_options = {
:update => update,
:with => "Form.serialize(''#{form}'')",
:url => { :action => "process_multiple" }
} %>
<% do_before ||= nil %>
<% click_fn =
2006 Apr 05
23
how to create RJS visual effects callbacks
I''m trying desperately to get visuall effects callbacks working in rjs
templates to no avail What I''m trying to do is fade an image, change
the div with the image to a new image, and then fade the new image back
in. How would I go about this in RJS Here''s a simple line from my rjs
that I can''t get to work. It is not using callbacks so the
2009 Jun 23
7
can't get remote_function working on rails 2.3.2
I''ve tried moving the code around in different ways, but so far I
haven''t gotten remote_function to work for me (I''m using Rails 2.3.2 on
my Mac). I want to make an AJAX call when I double-click a word on my
page, and the Javascript function is being called when the ondblclick
event is fired, but nothing happens when it gets to my the "new
Ajax.Request" part
2006 Mar 18
2
Additional link tag attributes with link_to_function...
Hi,
I''m having a bit of a struggle with link_to_remote. Everything works
exactly as I want it, but the problem is that I want to add another
attribute to the <a>-tag, namely class="". Long story short, I want
specific links to look differently from others, but all of them being
link_to_function. Normally, I''d do this with adding a class="foo" to
2006 Jul 20
0
Getting joined collections on a form
Greetings, I''m looking for suggestions on how to simplify getting customer
addresses on a form:
I''m jumping between controller and view several times; alternating between
rhtml and rjs, in order to display customers and their addresses on an
invoicing form. It''s very messy.
I have a one to many relationship between Customer and Addresses, each
customer has one or more
2006 Jul 21
0
Selecting customers and addresses in a form (was Getting joined collections on a form)
(Sorry if you have received this twice, I''m having trouble sending mail to
the rails list)
Greetings, I''m looking for suggestions on how to simplify getting customer
addresses on a form:
I''m jumping between controller and view several times; alternating between
rhtml and rjs, in order to display customers and their addresses on an
invoicing form. It''s very
2005 Dec 30
4
AJAX Drag and Drop Detecting Drop Coordinates
This one''s kicking me in the *(&#^. All I want to do is create a draggable
item and then detect the coordinates where it is dropped. So my first
approach was to just use the draggable_element with :revert => false, like
so:
<%= draggable_element "my_element", :revert => false %>
That works great and lets me drag stuff all over the place. In the
scriptaculous
2006 Jun 28
1
sortable lists, database update
Hi,
I have some images and I want to be able to drag them into the order I
want and have the database updated accordingly. I have an unordered
list elsewhere in the application that works well, but for the images
I cant get it working.
In my controller I have:
def updateorder
params[:images].each_with_index { |id,idx| ProductImage.update(id,
:display_order => idx) }
render :text
2006 Sep 10
2
Issue with radiobutton and remote_function in IE.
Hi there!
I did implemented the radio button with remote_function to update some
div via RJS.
It works perfect with FireFox, but behaves weird with IE. When I click
the radio button
it loads data (I see the indicator showing) but not updates the div with
info until I click
left mouse button anywhere.
It''s weird =(
Here is the snippet from .rhtml code
<td>
2006 Apr 18
4
update_page yields escaped code in callback
Hi All,
The subject pretty well describes what I am experiencing. This line in
an .rhtml template:
<%= link_to_remote menu_item.humanize,
{:update => ''section'',
:url =>{:controller => menu_item},
:complete => update_page do |page|
page.activate_tab("#{menu_item}_tab", ''menu_'')
page[''section''].hide
2006 Apr 22
2
selected value
I would like to pass the value selected in a select statement back so
that I can use it in the controller, through using a remote_function
call, and I cannot figure out what I am doing wrong:
view rhtml:
<select id="widgets_id" name="widgets[id]" onchange="<%=
remote_function( :update => "parts", :url=> { :action => :loadParts } )