What's the best (easy) way to implement a login/authentication system on a Rails web-app that looks and works like the Stackoverflow system?
I realize that it's basicly OpenID, but Stackoverflow handles integration with multiple providers.
Is there a easy way to this on Rails? Or do we have to hack restfull_auth or authlogic to do that...
I upgraded rails to 2.3.2 from 2.1.1 yesterday and a bunch of my tests started failing.
When I was running under 2.1.1, the test server was running on port 3000 so I had a HOST_DOMAIN variable that included the port - HOST_DOMAIN = "localhost.tst:3000". This is so my assert_redirected_to's would succeed.
Now, however, it seems that th...
Should I just go to SourceForge and try to find something that looks interesting by doing a search? Or is there a Ruby-specific website that helps you to find open source projects to contribute to?
After you find it one, do you usually just send an email to the project owner to see if you can help or do you just start submitting code to...
I've created some resources in my Ruby on Rails application:
localhost/admin/books
localhost/admin/users
localhost/admin/...
Now I want to create a static page which just contains links to these resources and is accessible from localhost/admin
I've tried to create the page in /public/admin/index.html and it works, but unfortunately I...
Now that I know how to find a Ruby open source project, how do I judge which ones are most likely to help my career prospects. I've never worked in the Ruby world and need something that might show off my potential to be a good hire. Or is any project as good as anything else as long it's something you're interested in? Also, would it ma...
This code is taken from a previous question, but my question directly relates to it, so I've copied it here:
class User < ActiveRecord::Base
has_many :group_memberships
has_many :groups, :through => :group_memberships
end
class GroupMembership < ActiveRecord::Base
belongs_to :user
belongs_to :role
belongs_to :group
end
class...
What is the best way to validate a gets input against a very long word list (a list of all the English words available)?
I am currently playing with readlines to manipulate the text, but before there's any manipulation, I would like to first validate the entry against the list.
...
Say I have a rails app with 3 models, Person, Place and Thing. Say the Thing uses single table inheritance, so there are FancyThing and ScaryThing subclasses. Then there are routes defined with map.resources :people, :places, :things. So there are no controllers for FancyThings and ScaryThings, the ThingsController handles either type...
When I make a new array/hash in irb, it prints out a nice format to show the structure, ex.
["value1", "value2", "value3"]
{"key1" => "value1"}
... but when I try to print out my variables using puts, I get them collapsed:
value1
value2
value3
key1
value1
I gather that puts is not the right command for what I want, but what is? I ...
I have done some testing but I wanted to ask if anyone sees a problem with this ruby regular expression for email validation:
/\A([^@\s]+)@((?:[-a-z0-9]+.)+[a-z]{2,})\Z/i
Look good?
Thanks,
Tony
...
I have a small ruby application that I made on my local machine. It uses a text file insted of a database. It's a simple app that takes in a word, processes it against the text file, and then outputs the results using puts.
I would like to fit it into a RoR framework, hosted on my personal machine. I have run through some lessons and ...
I want to build an XML map of all directories and files in my public/catalogs rails directory.(recursive map)
I would like it to be constructed with basic <directory> <file> element with name attribute equal to the dir or file name.
<catalogs>
<file name="index.html">
<directory name="foo">
<file name="file1.html" />
<directo...
I have been interested in learning Rails for some time now and feel now is as good as time as ever to dip in and actually get my hands dirty. I've spent the past week reading every free ebook on Ruby and Ruby on Rails I can find. I just finished reading Ruby Essentials. I have also been playing with http://tryruby.hobix.com/
I have ins...
I have a class hierarchy looks like this:
class Post < ActiveRecord::Base; end
class Project < Post; end
class ProjectDesignWall < Project; end
There's a controller that fetches data like so:
@projects = Project.find(:all, :include => [:project_image_photos,:user])
In development, this runs the following query, straight from the lo...
In my project I would like to select records from my database and then group them together by those that occurred at a similar time to the latest record within a certain time range.
For example, with a 1 hour time range. If a user created 3 posts between 4:30pm and 5:15pm, 2 posts between 1:15pm and 1:30pm, and 1 post at 10:00am I would...
Looking further into the differences between Python and Ruby, is there a Ruby equivalent to SciPy, or what other scientific math gems are available for Ruby?
...
I've been stuck on this all day. I have a setup like the one below. I'm trying to define friends using the group_memberships association.
class User < ActiveRecord::Base
has_many :group_memberships
has_many :groups, :through => :group_memberships
has_many :friends # what goes here? <<
end
class GroupMembership < ActiveRecor...
I want to generate the Ruby documentation with hanna template.
How to do that? Or where can I download it if it's available at all?
Using
rdoc -o ~/doc --inline-source --line-numbers --format=html --template=hanna
gives me docs with missing methods. It seems like it doesn't generate methods written in C.
...
How can I choose a file from a file browse dialog (i.e., uploading a file from my PC) in a Ruby Selenium automation script?
...
From the libxml-ruby API docs (http://libxml.rubyforge.org/rdoc/index.html), under LibXML::XML::Document, I tried the following:
filename = 'something.xml'
stats_doc = XML::Document.new()
stats_doc.root = XML::Node.new('root_node')
stats_doc.root << XML::Node.new('elem1')
stats_doc.save(filename, :indent => true, :encoding => 'utf-8')
...