Displaying 20 results from an estimated 2000 matches similar to: "Module in Rails"
2006 Aug 08
2
Extending rails with plugins
I''ve been looking at bottling some functionality up into a plugin, but I''m
having some problems including it.
The structure I have is:
/app/controllers/admin/base_controller.rb:
class Admin::BaseController > ApplicationController
#snip#
end
/vendor/plugins/myplugin/lib/my_module.rb:
module MyModule
def new_func
"New Function"
end
end
2012 Sep 28
2
nested modules and autoloading
All-
I''m using puppet 2.7.14. I''ve reviewed
http://docs.puppetlabs.com/puppet/2.7/reference/modules_fundamentals.html
but it doesn''t seem to cover what I''m attempting.
Consider a module layout like this:
$ tree mymodule
mymodule
|-- Modulefile
|-- README
|-- manifests
| |-- init.pp
| |-- special_type
| | `-- prereqs.pp
| `-- special_type.pp
2011 Aug 09
3
[LLVMdev] Adding a module in a pass
I have an optimization pass (FunctionPass) where I need to add global
constructors.
For cleaness sake I decided to add these in my own module. My module
is created in my FunctionPass constructor:
MyPass()
: FunctionPass(ID),
myModule("my_module", getGlobalContext())
{}
I generate an llvm.global_ctor global variable in my module, and I add
my global constructors
2006 Mar 21
2
Several ''app'' directories ?
Hello, I''m new to ROR and my first wonder is to understand how to
organize my application "per module"...
Imagine I want to build a web site including :
- the web site by itself
- a forum
- a wiki
- a shop
I would like to avoid putting all the controllers, views and models in
the same app directories, polluting the subdirs with prefixed files like
wiki_*, shop_*, forum_* -
2007 Jan 19
6
Problem w/ routes.rb
I am trying to develop a new webapp using Rails 1.2.1. I am installing
it onto a production web server running Apache w/ fastcgi. The server
already has some older webapps running on it using an older version of
Rails. The apps are not installed in the document root; they each have
their own subdirectory which is a symlink for the apache document root
to the "public" directory of each
2013 Nov 29
1
How to catch warnings sent by arguments of s4 methods ?
Hello,
I apologized if this had already been addressed, and I also submitted
this problem on SO:
http://stackoverflow.com/questions/20268021/how-to-catch-warnings-sent-during-s4-method-selection
Example code:
setGeneric('my_method', function(x) standardGeneric('my_method') )
setMethod('my_method', 'ANY', function(x) invisible())
2009 Jul 28
1
[PATCH ovirt-node] Removed subpackages, stateful, stateless, logos, and selinux for inclusuion in Fedora
rhbz#:51422
---
ovirt-node.spec.in | 149 +++++++++------------------------------------------
1 files changed, 27 insertions(+), 122 deletions(-)
diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in
index 3138011..b4e660d 100644
--- a/ovirt-node.spec.in
+++ b/ovirt-node.spec.in
@@ -43,76 +43,23 @@ Requires: nc
Requires: grub
Requires: /usr/sbin/crond
Requires: anyterm
2006 Jun 17
1
magic disappearing parameters
I have a method in application_helper.rb like this:
def my_method(arg1, arg2 = {})
...
end
when I call this method from an rhtml file like this:
my_method @var
I get this message:
wrong number of arguments (1 for 0)
When I call the method without arguments like this:
my_method
I get this message:
wrong number of arguments (0 for 1)
I am new to Ruby and Rails so I presume that
2008 Apr 04
5
First call to worker method doesn''t work
I have a worker as follows:
class SampleWorker < BackgrounDRb::MetaWorker
set_worker_name :sample_worker
def create(args = nil)
# this method is called, when worker is loaded for the first time
end
def my_method
# Deliver test e-mail message
Notifications.deliver_message(1, "DM")
end
end
I have a rails controller that calls the following code:
worker =
2005 Sep 27
2
No Custom Validation
Hi,
Correct me if I am wrong but there doesn''t seem to be an easy way to add
validation outside the pre-built ones (validates_presence_of,
validates_lenght_of, etc.).
Ideally there should be something like:
Class Person < ActiveRecord::Base
validates :my_method, :on => create, :message => ''was not valid''
def my_method(param)
false unless
2008 Feb 18
3
Calling a controller inside a module
I tryied everything:
:controller => ''MyModule::Core::Controller''
require ''MyModule/core/controller''
include MyModule::Core
But nothing works !!!
Question is very simple:
How to call a controller that belongs to a Module inside the router.rb file?
This cannot be that difficult!
Thanks!
-Sergio
-------------- next part --------------
An HTML attachment
2007 Jul 16
4
Set the return value to "same as block"
It would be good to be able to set the return value to be the same as
the return value of the block. I am trying to test opening a file in a
block and reading from it. It would be nice to use code like this:
object.stubs(:open).with("/path/to/file", "r").yields(
stub(:read => "The file contents")
).returns(from_block)
Which would make open() take the return
2005 Dec 28
2
where is WEBrick (daemon mode) output? not in log/server.log
I am running WEBrick in daemon mode (with the -d option). Where is the
server output that would ordinarily be on my console if I ran without
the -d option?
APP_ROOT/log/server.log is empty and not being appended to, though it is
owned by the same user WEBrick is running as and has write permissions.
The only files in APP_ROOT/log are:
development.log
production.log
server.log
test.log
Where
2006 Apr 14
8
Error with Web Service tests after upgrading to Rails 1.1.2
Hello.
I hope this is the right place to describe my problem ?
After upgrading to Rails version 1.1.2 from rails version 1.0.0, Web
Service functional tests seem broken.
I upgraded rails (as the root user / administrator) with:
# gem update rails --include-dependencies
then I upgraded my application (as myself) with:
? rake rails:update
% rake rails:update:configs
After these steps,
2006 Jun 19
1
AJAX - Image output to an IMG tag ?
Hi,
I''m using the "link_to_remote" AJAX function call from my "view", and
what i want is after i get the results from the function call, I want to
update the result
directly into to an image ie. <IMG> tag, how to do this.??
ie. if we want to update the result into a ''div'' element we do like
this, which works fine..
link_to_remote(:update
2006 Jul 27
2
accessing a variable inside a plugin
Hello,
I would like to load an Hash in my init.rb plugin file ... than I would
like to use this hash in my module ...
in my init.rb:
@anHash = load From file...
in mymodule:
module Amodule
def myFunction
#@anHash ....
end
end
How can I access to my hash in my plugin module function ?
thanks for this dummy question ;-)
Arnaud
2011 Apr 18
3
paypal with Active merchant
Hi, I am integrating paypal service in my application using Activemerchant.
Now I want to know how to use ActiveMerchant to make payment to Bank or
Credit card ?
for example:
I am seller and I want to pay some amount to somebody. I want to pay such
amount which will be credited in somebody''s bank account or credit card
directly ?
Please reply me as early as possible.
And also suggest
2008 Oct 28
7
How to override one method of AssetTagHelper
I created a file ./lib/action_view/helpers/asset_tag_helper.rb
and put in it only the method I want to override. like this
module ActionView
module Helpers #:nodoc:
module AssetTagHelper
def image_path(source)
compute_public_path(source, ''images'')
end
end
end
end
But as soon I try this all the others methods from the overriden module
are not
2007 Aug 15
8
Extra Options to Heckle
I''ve tried running Heckle with rspec on some of my classes, but keep
getting (what I believe to be) an infinite recursion. Is there some
way to supply extra options to heckle via. rspec?
Scott
2011 Aug 26
2
Prevent Infinite loop in Self-Join Association
Hi, I have such a data base which has a self-join as association.
I want to know that is there any good gem available which i can use for
self-join in my application?
My main intension is to prevent infinite loop in searching the records.
@Anand
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email