I'm looking for a solution for collaborative filtering in rails or even possible examples. So far I have only found acts_as_recommendable which looks useful but I noticed it hasn't had any updates in the last 2 years.
Does anyone know of any other solutions and/or examples?
...
I have a Rails application that lists information about local services. My objectives for this model are as follows: 1. Require the name and tag_list fields. 2. Require one or more of the tollfreephone, phone, phone2, mobile, fax, email or website fields. 3. If the paddress field has a value, then encode it with the Geokit plugin. Here i...
Is there an easy way in Ruby for me to get a list of the IP addresses for all network interfaces? It needs to work in Linux/Win/OSX and I'd prefer to not have to parse ifconfig/ipconfig unless I absolutely have to.
...
Is it possible to get the parameter names of a method ?
Example with:
def method_called(arg1, arg2)
puts my_method.inspect
end
I would like to know what method (my_method) should I call to get the following output:
["arg1", "arg2"]
...
I have this code.
class MyParser < Nokogiri::XML::SAX::Document
def characters(string)
LOG.debug("characters #{string}")
end
def start_element(name, attrs = [])
LOG.debug("start_element #{name}")
end
def end_element(name)
LOG.debug("end_element #{name}")
end
end
parser = Nokogiri::HTML::SAX::Parser.new(MyParse...
I need to move a folder from a plugin to the main app/views. I guess using rake to do this with the following command is the easiest way:
require 'fileutils'
FileUtils.mv('/vendor/plugins/easy_addresses/lib/app/views', '/app/views/')
I'm just not sure where to tell script where to look and where to place the folder.
The file I want...
Hello,
I have the following hash of countries;
COUNTRIES = {
'Albania' => 'AL',
'Austria' => 'AT',
'Belgium' => 'BE',
'Bulgaria' => 'BG',
.....
}
Now when I output the hash the values are not ordered alphabetically AL, AT, BE, BG ....but rather in a nonsense order (at least for me)
How can I output the hash having the ...
Hello, I'm looking for any pointers on how to write a rails web app without ActiveRecord.
A doc or an example of a (not too complex) web app using storage backends other than a relational database would be greatly appreciated.
It's not clear on what should be implemented in the model classes in order to make the rails app work without ...
Hi,
I don't know anything in Ruby, but i'm pretty interested in DSLs. And DSL seems to be a buzz word for you community.
Do you actually implement DSLs in Ruby for your own purposes ? If so, how complex and how dedicated are they ?
i've seen this question here, but i'm more interested in your everyday experience.
thanks.
...
Does Scala have a version of Rubys' each_slice from the Array class?
...
I need to use Ruby to create some SQL statements for a MySQL database. Ruby will never connect to the database. The SQL statements will be sent to another site and executed against the MySQL database.
Since the machine running Ruby does not have a connection to the database, is it possible to use DBI's prepare statement without creati...
Hi all,
I'm fairly new to both Rails and Heroku but I'm seriously thinking of using it as a platform to deploy my Ruby/Rails applications.
I want to use all the power of Heroku, so I prefer the "embedded" PostgreSQL managed by Heroku instead of the addon for Amazon RDS for MySQL, but I'm not so confident without the possibility to acces...
I'm doing some unit testing, and some of the code is checking to see if files exist based on the relative path of the currently-executing script by using the FILE variable. I'm doing something like this:
if File.directory?(File.join(File.dirname(__FILE__),'..','..','directory'))
blah blah blah ...
else
raise "Can't find directo...
I've only ever learned to "program" with notepad when I was learning to create batch files in Windows.
I would appreciate if you can explain to me the benefits of working with an IDE over a text editor or vice versa. Please don't give emotional responses or argue someone else's suggestion/advice. I use Linux primarily. Also, I would lik...
Hey there,
I am trying to install the cairo ruby gem on OSX 10.6. There seems to be a bug in the extconf.rb, which I've patched, but now I don't know how to create a gem, so I can install it... gem build folder won't work because there is no gemspec file or whatever (I've got absolutely no experience with gems^^), and gem install wants ...
For this project, I need to be able to mix Haml tags within the Maruku filter. For example, will I be able to do this:
#contain
:maruku
## Hello H2 Tag
div{:id => 'divinmaruku'}
**Can I do this?**
I know you can just unindent where you want to get out Maruku, but it is a pain to do :maruku whenever I want to use it...
One of my favorite features of Google docs is the fact that it's constantly automatically saving versions of my document as I work. This means that even if I forget to save at a certain point before making a critical change there's a good chance that a save point has been created automatically. At the very least, I can return the documen...
This post is somewhat similar to this other post:
http://stackoverflow.com/questions/128660/how-can-i-make-rubys-soaprpcdriver-work-with-self-signed-certificates
except I'm using WSDLDriverFactory:
@loginWsdlUrl = 'https://localhost:9843/services/LoginService?wsdl'
loginClient = SOAP::WSDLDriverFactory.new(@loginWsdlUrl)
loginClient.o...
I'm searching for a library to edit already existing PDF's and add a watermark to each page, for example. Could also be blank every other page etc.
There seem to be a few PDF libraries out there, but only very few of them can edit existing PDF's and I'm a bit lost on which way to go.
Any recommendations?
Thank you.
...
My deploy.rb sets some environment variables to use the regular user's local Ruby rather than the system-wide one.
set :default_environment, {
:PATH => '/home/myapp/.rvm/bin:/home/myapp/.rvm/bin:/home/myapp/.rvm/rubies/ruby-1.9.1-p378/bin:/home/myapp/.rvm/gems/ruby-1.9.1-p378/bin:/home/myapp/.rvm/gems/ruby-1.9.1-p378%global/bin:/home/...