Displaying 20 results from an estimated 1200 matches similar to: "Extending Ruby classes in Rails"
2006 Aug 06
6
Having Problem w/ Agile Web Development book
I get this error ...
NoMethodError in StoreController#index
undefined method `salable_items'' for Product:Class
and here is my store_controller.rb ...
class StoreController < ApplicationController
def index
@products = Product.salable_items
end
def self.salable_items
find(:all, :conditions => "date_available <= now()", :order =>
"date_available
2006 Jul 14
8
CAS Authentication filter.
Hi
CAS is a centralized authentication service, and the cas_auth filter can
be installed to automatically make your web application authenticate
against a CAS server. The SVN path to the plugin is
http://svn.ki.se/rails/plugins/cas_auth
and a homepage with some information can be found at
http://opensource.ki.se/casauth.html
For use, just install the plugin in your application and set
2006 Jul 21
4
Autocompleting InPlaceEditor
Hi,
I''ve created some extensions to script.aculo.us InPlaceEditor, allowing
the use of either server-driven, or local autocompletion. I''ve also
created new helper methods in Rails for this functionality.
My question is, is there any interest that I package this and make it
available as a plugin, or something like that?
Regards
--
Ola Bini (http://ola-bini.blogspot.com)
2006 Jul 14
4
sending additional parameters to before_filter
i am trying to create a system so that different users have different
priviliges on my application. i was going to modify my authorize
function so that i could pass the required role to it and have it check
the current user for that role.
i am using before_filter and would like to have just one function
instead of writing one for each role like so:
authorize(role)
instead of:
2006 Aug 07
5
Store SOAP::RPC::Driver in user session throws TypeError
Hi All
I have a
requirement to consume a 3rd party web service from my Rails
application. I am doing this
in my action
require ''soap/wsdlDriver''
factory = SOAP::WSDLDriverFactory.new(TRANSIDIOM_WSDL_URL)
soap = factory.create_rpc_driver
soap.wiredump_file_base="#{RAILS_ROOT}/log/transidiom.log"
param = %(<Request
2006 Jul 14
2
Configuration search order
Hi
I''m in the process of deciding how a plugin should be designed to make
configuration as easy as possible. Right now I require the plugin from
init.rb, and set some configuration options (as class attribute
accessors) from environment.rb. Then I tried setting these from
environments/development.rb instead, and to my surprise this didn''t
work. It said the class in question
2006 Aug 16
4
Plugins and svn
Hi railers,
What do you do when you must use a plugin in a rails app that is under
subversion?
I think that an approach is simply install a version of the plugin, and once
all the test pass, commit the plugin itself to the repository, inside the
/vendor/ of the app. If a new version of the plugin is released, your app is
still using the working one (although the new version could work too).
2006 Aug 03
3
Swedish Rails
I would like to announce my plugin Swedish Rails.
Rails provide many goodies and helpers for you, but some of these are
dependant on your user interface being in english. Date controls, for
example. Pluralization is another. And have you ever tried to capitalize
a string with Swedish letters in them? Then you know it doesn''t work
that well. Until now, that is. You install this
2006 Jul 22
1
InPlaceEditor with Autocompletion
Hi
Rails AJAX controls are very handy, and the InPlaceEditor is probably
one of the easiest and most neat of them all. But, it doesn''t do
autocompletion. I''ve rectified that situation. The plugin provides a few
new helpers and a new JavaScript-file that extends the
Ajax.InPlaceEditor with local and remote Autocompletion features. So,
just install the plugin, include the
2006 Aug 03
5
Database configuration across developers!
Hi,
I have what might be a silly question but is there any way to put some
of the database configuration information into a separate file? For
instance, in config/database.yml I have:
developer_database: &developer_database
adapter: mysql
username: me
password: something
host: 127.0.0.1
development:
<<: *developer_database
database: foobar_development
test:
<<:
2006 Aug 03
5
Rails - forms
Currently I have a registration form that is built like this:
<label for="First name">First name</label>
<%= text_field "user", "first_name" %><br>
<label for="Last name">Last name</label>
<%= text_field "user", "last_name" %><br>
<label for="Email">Email</label>
2006 Jul 14
6
Don''t understand :: in ActionController::Base
Maybe this should apply to Ruby forums directly, but I''ll try here.
I understand the concept of classes and subclasses thanks to the
excellent "Programming Ruby - The Pragmatic Programmer''s Guide".
However, I don''t understand what :: signify in terms of inheritance,
parent and child in e.g.
ActionController::Base
--
Posted via http://www.ruby-forum.com/.
2006 Aug 02
2
Passing Ajax.InPlaceEditor options
I''ve followed the instructions in the Rails Recipe #1 and have the
in_place_editor_field working but now I want to tweak how it looks and
behaves. I''d like to be able to override the default yellow highlight color,
which is done using the highlightcolor param according to the scriptaculous
documentation (unless I''m missing something).
I''m new to Ruby and Rails
2006 Aug 11
2
Array#chunk method, maybe someone will find this useful
class Array
# break an array up into <size> chunks
def chunk(size=1)
return self if self.empty?
raise ArgumentError if !size.kind_of? Integer
y = self.length.divmod(size)
rows = (y[1] > 0) ? y[0] + 1 : y[0]
arr = Array.new(rows)
(0...rows).each do |i|
arr[i] = self.slice(size*i, size)
end
(arr.last.length...size).each { |i| arr.last[i] = nil }
2007 Dec 28
1
JtestR 0.1 released
JtestR allows you to test your Java code with Ruby frameworks.
Homepage: http://jtestr.codehaus.org
Download: http://dist.codehaus.org/jtestr
JtestR 0.1 is the first public release of the JtestR testing tool.
JtestR integrates JRuby with several Ruby frameworks to allow painless
testing of Java code, using RSpec, Test/Unit, dust and Mocha.
Features:
- Integrates with Ant and Maven
- Includes
2006 Aug 02
7
Same error ... again.
I reached page 82 of the Book "Agile Development with Rails" First
Edition. After I compiled the code I got the following error message.
[CODE]
NoMethodError in Store#display_cart
Showing app/views/store/display_cart.rhtml where line #11 raised:
undefined method `product'' for 1099.0:Float
8: <table>
9: <%
10: for item in @items
11: product = item.product
12:
2006 Sep 04
8
ActiveRecord-JDBC is coming along
The ActiveRecord-JDBC adapter is rapidly maturing these days. I got the full
set of AWDwR2 migrations to run with it against MySQL last night, and Ola
Bini has gotten migrations working well against Oracle and Firebird. We also
have SQL Server support running most of our test cases (under non-Windows
environments too!) and have started adding support for Derby and HSQLDB
(Java-based DBs). Things
2006 Jul 13
2
EmacsRails cheat sheet
Hi
I''ve compiled a small cheat sheet for Emacs-Rails. It can be found here:
http://os.ologix.com/emacs-rails-cheat.pdf
--
Ola Bini (http://ola-bini.blogspot.com)
JvYAML, RbYAML, JRuby and Jatha contributor
System Developer, Karolinska Institutet (http://www.ki.se)
OLogix Consulting (http://www.ologix.com)
"Yields falsehood when quined" yields falsehood when quined.
2006 Jul 27
7
cannot get past "Booting WEBrick"
Hi Everyone,
I am following the ''Agile Web Dev. with Rails'' book, and I used instant
rails to do the install on a Windows machine. Everything seemed to work
fine until I got to:
Booting WEBrick...
After that, nothing happens. I tried creating a new rails application, but
I get the same
problem. I also tried reinstalling to no avail.
Any ideas?
Thanks for the help.
2006 Jul 22
10
Non English characters
Hi folks,
Does anyone know how to tackle Swedish letters in Rails. Am I
completely off track in thinking that it should be done using map or
regex in some clever way?
Bealach