Displaying 20 results from an estimated 300 matches similar to: "RJS where to put helper method?"
2006 Jul 14
5
migration and inserting default data
Hi,
I''m wondering is there a way to load default data in the migration script?
So, for example I''m creating new table to store the order status, I also
want to pre-populate the table with some data from a sql file.
I have done a quick search on the list but cannot find anything.
thanks,
- reynard
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Aug 15
3
Testing deleting files
In unit or functional test, is there a way to check that a file has been
deleted?
It seems that running the test does not really execute deleting files, which
is good because I don''t want it to actually delete the files. But can I
check that the deletion should have been performed in test environment?
thanks,
- reynard
-------------- next part --------------
An HTML attachment was
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 13
6
why some features uses new and some just static function call
Hi,
when using prototype and scriptaculous, isn''t it confusing sometimes to
remember which ones you have to use new and which ones that are just static
function call.
For example:
new Insertion.Before(...);
new Effect.Opacity(...)
Effect.Fade(..);
Effect.Appear(...);
I havent really looked at the implementation, but out of curiosity, I''m just
wondering is there a reason some
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 :
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 Aug 10
2
Is it possible for a controller to throw up a message box?
I need my controller to give some feedback to the user by popping up a
message box. Does anyone have any ideas how this can be done?
Thanks
--John
--
Posted via http://www.ruby-forum.com/.
2006 Jun 02
1
Ajax: update multiple DIV''s
Hello.
Is it possible to update multiple DIVs during? For example I have DIV
for @flash[:notice], and one for content and I need to render both DIVs
after executing action.
2006 Apr 03
1
Q: periodically_call_remote ( how to make it execute just once? )
I posted this ealier on the web forums but noticed a similar question
about this function and one user responded to try this list instead. If
anyone can help I would greatly appreciate your suggestions.
Q:
Is there a way to use periodically_call_remote to run just one time
instead of every '':frequency'' seconds?
I tried putting the call inside the div container thinking it
2008 Jan 15
2
rails rjs page object
Can anyone point me to api documentation for the page object that is
used in rails rjs files?
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send
2006 May 17
4
.rjs templates undesiered output problem
Hello everyone, I am working with rjs templates in rails, and I''m amazed
of how simple it is to generate code with ajax, however I''am having some
troubles and I can''t seem to find a way to solve''em.
Whenever I put some code in the template, let''s say:
page.visual_effect :highlight, ''sitio37'', :duration => 3
I get the
2008 Nov 22
3
RJS page.update question
How does page.update actually work? I know its a wrapper for
Prototype.update but how does it get the partial in there?
Say I wanted to update a div with the contents of a partial manually
like this.
content = render(:partial => ''whatever'')
page.call "$(''my_div'').update(#{content})"
But his does not work. It keeps giving me weird errors about
2006 Aug 01
6
Getting Started on RJS Templates
I definitely need to use RJS templates for my current application. I''ve
used Google for the past twenty minutes or so, yet I can''t find a good
resource that will get me started and show me what the page object can do.
Any links?
When an Ajax link is clicked, I''m trying to change the background of a
"primary" list item, as well as the background and text of
2008 Jan 17
6
how to control self.method access
i think self.method just like class method,so if i want to define it
as a private method,i should use
private_class_method :my_method
but i found follow code in < <Agile Web Development with Rails>>
private
def self.hash_password(password)
Digest::SHA1.hexdigest(password)
end
just a mistake or there have some thing which i cannot get?
2006 Jan 30
2
problem redefining module method
I''m having a problem redefining a method in one of my modules. Lets
say I have this module in /lib:
module Hello
def say_hello
"hello"
end
end
And one of my ActiveRecord models mixes it in like:
class Item < ActiveRecord::Base
include Hello
end
This works fine, I can call @item.say_hello just fine. But when I try
to redefine the method:
class Item <
2008 Jul 20
4
how does request.host get set?
how does request.host get set? Is there a way to manually set the
value in request.host?
I have several application servers running rails, each has its own
internal address in the request.host, so when calling redirect_to or
url_for function, it uses the internal address which is not accessible
to the user.
what I want is to set request.host to return mysite.com, no matter
which application
2008 Jan 02
3
disabling backgroundrb_debug.log
is there an easy way to disable logging to backgroundrb_debug.log?
Regards
- reynard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20080102/195dee18/attachment.html
2007 Nov 07
2
workers cleanup
Hi,
I''m using backgroundrb 0.2.1 and having problem with worker processes
staying around when the rails application does not explicitly delete
them.
Is there a way to automatically delete the worker processes when it
has completed the job?
Also does killing the process manually (using kill command) harm the
backgroundrb server? I have some occasions where the backgroundrb
server just
2007 Dec 18
1
process queue
I noticed that backgroundrb does some kind of process queueing now? When I
pounded the server to create 1000 workers, there are always only around
30-40 processes running at a time, which is good :)
Is there some configuration for adjusting the max process?
- reynard
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Oct 01
9
How to create a very simple form
Hi all,
I would like to create a very simple form with RoR similar to this one
in ASP.Net:
http://quickstarts.asp.net/QuickStartv20/aspnet/samples/ctrlref/standard/TextBox/TextBox1_vb.aspx
I my RoR project I want to add a Greeter class like this one:
class Greeter
def initialize(name = "World")
@name = name
end
def say_hi
puts "Hi #{@name}!"
end
def