Displaying 12 results from an estimated 12 matches for "say_hello".
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 < ActiveRecord::Base
include Hello
def say_h...
2009 Jul 28
4
RJS-Template and link_to_remote
...that template
e.g. ''page'' or ''replace_html''. I get an error message on these
methods.
Here''s what I got so far in my example:
Controller:
----
class AjaxTestController < ApplicationController
layout ''application'', :except => :say_hello
def index
end
def say_hello
@message = "Hello World"
respond_to do |format|
format.js
end
end
end
----
Layout
----
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www...
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
2010 Feb 11
2
LinkingTo and C++
...ying to make LinkingTo work when the package linked to has
c++ code.
I've put dumb packages to illustrate this emails here ;
http://addictedtor.free.fr/misc/linkingto
Package A defines this C++ class:
class A {
public:
A() ;
~A() ;
SEXP hello() ;
} ;
Package B has this function :
SEXP say_hello(){
A a ;
return a.hello() ;
}
headers of package A are copied into inst/include so that package B can
have.
LinkingTo: A
in its DESCRIPTION file.
Also, package B has the R function ;
g <- function(){
.Call("say_hello", PACKAGE = "B")
}
With this I can compile A and...
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 Feb 14
3
Can Ajax updates more than one <div>?
Hi,
I wish to know, is it possible that Ajax can update
more than one zone "<div>"???? like :
<%= link_to_remote("Title", :update => ''mydiv0'', :url
=> {:action=>:say_hello} )%>
<div id="mydiv0"> to be changed one</div>
<div id="mydiv0"> to be changed two</div>
When I execute the code, only the first line is
changed, the second one doesn''t...
thanks you very much
Saiho
__________________________________...
2007 May 10
13
Is there a way to do incremental search?
Say the user first enters "ruby" for search and gets 1000 results. Then
he can search "rails" just in the 1000 results just returned.
The common scenario is some kind of advanced search. User can
incrementally add criteria and the program will narrow the results step
by step.
I know that at least I can use all the criteria as a whole to do the
searching, but this is a waste
2006 Mar 07
3
STI and unit testing
...- here''s the output:
C:\WINDOWS\system32\cmd.exe /c ruby bar_test.rb
Loaded suite bar_test
Started
.Bar
.Foo
.
Finished in 0.109 seconds.
3 tests, 3 assertions, 0 failures, 0 errors
shouldn''t BarTest only have two tests? test_say_hi() which is inherited from
FooTest and test_say_hello(), I don''t understand why the parent test case is
also being run. Can anyone shed some light on this please?
thanks in advance
alan
code (also pasted to http://www.pasteserver.net/paste/show/152):
1 # model Foo, created using generator
2
3 class Foo < ActiveRecord::Base...
2007 Mar 13
0
aliasing, require_dependency and require
...g reloading of application.rb.
The same behaviour is observed if I use the following module included
method:
#speaker plugin init.rb
#require ''application''
require_dependency ''application''
module Speaker
def self.included(base)
base.alias_method_chain :say_hello, :speaker
end
protected
def say_hello_with_speaker
puts "Hello speaker...."
end
end
ApplicationController.send(:include, Speaker)
Any help heres is much appreciated...
Regards,
Saimon
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~----------...
2007 Nov 14
7
BackgrounDRb version 1.0RC1 available now
...econd form of scheduling as shown in config file.
- add_periodic_timer method
A third and very basic form of scheduling that you can use is,
"add_periodic_timer" method. You can call
method from anywhere in your worker.
def create
add_periodic_timer(5) { say_hello }
end
Above snippet would register the proc for periodic execution at
every 5 seconds.
=== Code
Install the plugin, and run setup task. Create a worker, using
worker generator.
./script/generatr worker bar
You will have a bar_worker.rb in your RAILS_ROOT/lib/workers...
2006 Mar 30
25
TextMate for Rails development -- why?
Greetings,
I am curious, I see quite a few references to using TextMate for
rails development. I downloaded TextMate and used it for 30 days. I
do not see what everyone is raving about. Snipplets are nice, but
other editors do the same thing, some with much more power.
Can anyone tell me what makes people draw to TextMate? Maybe I am
missing the whole reason, I''d really like to