Displaying 20 results from an estimated 4000 matches similar to: "passing data from controller to rjs and then to partial"
2006 May 01
7
where should I put my hand-coded classes
I have a class that is hand-coded (not generated using generator).
Is there a preferred location for the file.
app/components ?
does it matter?
Thanks,
--
Posted via http://www.ruby-forum.com/.
2006 May 01
5
Adding classes without script\generate
Can I add classes to a rails application manually i.e without using
script generate Model/Controller?
The reason I am asking, I added a class by putting it in the controller
class. I can access the class and its method from command-line (irb),
but when I try to instantiate it in another controller, I get
"uninitialized constant" error.
If I try using script\generate Model
2006 Apr 22
3
Ajax call not being made on a Sortable list
Hi,
I am creating a sortable list using this code:
<%= sortable_element("fields_list",
:url => { :action => "order", :id => @fields_list })
%>
it creates a sortable and I can move elements up and down, but it is not
making any call to the "order" method.
I do not see any log activity in the development log nor do I see any
errors there. The
2006 May 01
3
Using Classes in Rails
I am a beginner so please excuse me, if i am doing something totally
wrong.
I have created a class using "wsdl2ruby.rb" and here is what it looks
like:
class ServiceSoap < ::SOAP::RPC::Driver
DefaultEndpointUrl =
"http://balrog/services/SearchWorker/service.asmx"
MappingRegistry = ::SOAP::Mapping::Registry.new
Methods = [
...
--
Posted via
2006 Apr 21
2
Passing Variables to a sub template
Hi,
I must be missing something very basic here.
I have a parent template and I am calling a sub template like...
<%= render( :partial => "window_title_bar", {"heading" => "Product
Details"}) %>
and in the sub template (_window_title_bar.rhtml), i am doing
Heading: <%= heading %>
but I am getting syntax error in the master template at line
2006 Aug 09
2
Can :before and :success move from view file into .rjs file?
Within the RJS template is there a way to specify when the visual_effect
should occur?
I''m trying not to repeat the :before and :success blind_down
visual_effect statements throughout my views.
It seems like the rjs templates can only take visual effects statements
in the form of
page.visual_effect :blind_up, ''divname''. I can''t figure out how to add
2006 Feb 18
2
Effect queues with RJS templates and scriptaculous
Hi. I was wondering if it''s possible to combine effects for
individual elements with RJS templates. I notice that scriptaculous
has support for a concept called effect queues
(http://www.railsdevelopment.com/2006/01/15/effectqueue/). Is there
anyway to use these queues from rjs?
2006 Jun 26
1
RJS visual_effect toggle?
Is there a way to toggle an effect in an RJS? If not, anyone have
recommendations for how to manually make it toggle? I guess I would
assume some boolean that the rjs checks everytime it''s called and
depending on whether it''s true or false it will do page.visual_effect
:appear or page.visual_effect :hide
-Ben Lisbakken
--
Posted via http://www.ruby-forum.com/.
2006 Apr 03
5
RJS Queue
Hi,
I''ve been able to succesfully queue page.visual_effect commands in my
RJS templates. Each command will wait to execute until the previous
command is done executing.
But I''d also like to execute a page.replace_html command AFTER the
page.visual_effect commands. I have a series of five DIVs:
div1
div2
div3
div4
div5
When the user clicks on div1, a page.visual_effect
2006 May 02
3
web services on the client side
i am reading through chapter 20 of the agile web development book and
trying to figure out how to use web services. i set up two different
rails apps. one as the server and one as the client. setting up the
server seems to work fine. but when i use the example at the end of the
chapter to set up a client, i get the following error when i open the
page:
Missing API definition file in
2006 Jul 20
5
RJS where to put helper method?
Hi,
If I want to have helper method for my rjs, where''s the best place to put
it?
so for example:
--- bla.rjs:
page.replace_html ...
page.visual_effect ...
--- somewhere: (currently I put in application_helper.rb)
def replace_with_effect(page)
page.replace_html ...
page.visual_effect ...
end
--- bla.rjs:
replace_with_effect page
and is there a way to define the helper so we
2006 Jan 19
1
rjs problems
Hi,
I am having trouble with rjs templates. Basically I want the item_div
to fade if its already open and then display the new item that the
user selected with the visual effect: appear. The code below causes
the browser (firefox on osx) to open the div and then close it again
as soon as it is open:
page.visual_effect :fade, ''item_div'', :duration => 0.5
page.replace_html
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 Apr 07
5
RJS support "toggle" effect?
Does RJS inherently support the Element.toggle effect? I haven''t been
able to call it the way you call "appear", "fade", etc...
Jeff
--
Posted via http://www.ruby-forum.com/.
2005 Dec 25
5
RJS not working?
I''ve been attempting to add a simple rjs ''delete'' method to my
project. However, no matter what I try, it simply doesn''t work. Even
the easy, easy stuff seems broken. (Yes, <%=
javascript_include_tag :defaults %> is being included in the template.)
For example, from:
http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates
VIEW:
<h1
2006 Jul 06
2
rjs rails to execute?
I have the following:
layout:
<%= javascript_include_tag :defaults %>
[...]
<div id="menu">
<div id="myrandom"></div>
<%= render :partial => ''menu'' %>
</div>
menu partial:
<%= link_to_remote "Generate Text",
:update => ''myrandom'',
:url => { :action =>
2008 Oct 29
0
RJS problem after upgrading to Rails 2.0.2
I just updated an old app from 1.2.6 to 2.0.2 and I''m having an rjs problem.
I have one page that has 2 submit to remote buttons, one to do a price
override and the other to remove the lineitem. Everything is working
perfectly before the update but now the price override doesn''t update the
page. I''ve verified that the price_override method still gets called
because
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 31
4
RJS to find an element
I''m trying to implement a remove from cart method based on the
examples in the second edition Agile book. I have everything working
except for the RJS that removes items from the cart. Ideally what
I''d like to do is highlight an element that I am deleting only if
there is more than one of that particular item in the cart. If the
item deleted is the only of
2010 May 24
2
Two RJS visual effects will happen at the same time?
I was going to change the background of a div from white to red and then
from red back to white, so this is used in an RJS file:
page[:vote_score].visual_effect :highlight, :startcolor => ''#ffffff'',
:endcolor => ''#ffcccc''
page[:vote_score].visual_effect :highlight, :startcolor => ''#ffcccc'',
:endcolor =>