I am considering using MongoDB (mongo-mapper) for a portion of my rails application. I am not ready to go whole hog MongoDB because there are too many useful gems that depend on a traditional DB.
That being said there are parts of my application that would be great to leverage a document database.
Has anyone had success mixing the two...
I've got a search form on this page:
http://staging-checkpointtracker.aptanacloud.com/events
If you select a State from the dropdown you get zero results because you didn't select one or more Event Division (checkboxes).
What I want is to default the checkboxes to "checked" when the page first loads...to display Events in all Division...
Hi,
I am trying to make the open_id_authentication plugin working.
Initially was doing it with authlogic but abandoned because it feels like much more hassle the help.
The problem is that I am getting OpenIdAuthentication.store is nil. Using in-memory store. warning in the log which prevents from authenticating users correctly.
Here i...
I'm creating a user system for Rails, and login, sign up etc... all works. Awesome! At least, that is what I thought. I tried to update the profile attribute of a user, but I don't send a new password or username with it. I use this in my User model:
protected
def after_validation
self.password = Password::update(self.password)
end
...
I installed Ruby via the RubyInstaller 1.9.1 RC2 available from rubyforge, updated gems, and installed rails. Everything worked fine using webrick. For fun, I installed mongrel using "gem install mongrel". The installation went fine:
Successfully installed gem_plugin-0.2.3
Successfully installed cgi_multipart_eof_fix-2.5.0
Successful...
I have the following associations:
class User < ActiveRecord::Base
has_and_belongs_to_many :brands, :join_table => 'brands_users'
has_and_belongs_to_many :companies, :join_table => 'companies_users'
end
class Brand < ActiveRecord::Base
belongs_to :company
has_and_belongs_to_many :users, :join_table => 'brands_u...
The title pretty much says it all. Don't overlook the 'date AND TIME' part though.
...
Hi All,
Does any one know solution to tracking online users in Rails; when you have cookie based sessions? I am using Rails 2.3.5. If yes please let me know.
Thanks, Atul
...
I have a named scope (name) combination of first and last name and I'm wanting to use this in a search box.
I have the code below:
named_scope :full_name, lambda { |fn| {:joins => :actor, :conditions => ['first_name LIKE ? OR second_name LIKE ?', "%#{fn}%", "%#{fn}%"]} }
def self.search(search)
if search
self.find(:all, :conditi...
I'm trying to pass in both the field and the value in a find call:
@employee = Employee.find(:all,
:conditions => [ '? = ?', params[:key], params[:value].to_i)
The output is
SELECT * FROM `employees` WHERE ('is_manager' = 1)
Which returns no results, however when I try this directly in mysqsl using the same call with...
I'm using GMail as my SMTP server. I have that configuration working just fine:
# config/initializers/action_mailer.rb:
ActionMailer::Base.smtp_settings = {
:tls => true,
:address => "smtp.gmail.com",
:port => "587",
:domain => "www.example.org",
:authentication => :login,
:user_name ...
I have no idea what went wrong but I can't get belongs_to work with :class_name option. Could somebody enlighten me. Thanks a lot!
Here is a snip from my code.
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.text :name
end
end
def self.down
drop_table...
Packet sniffers generally do not capture localhost traffic. I need to inspect some post data in a localhost environment (being generated from a Ruby on Rails development). Do you know of any programs that expose localhost packets?
...
The current convention where I work is to use SQL Server schemas like namespaces (e.g. Company.Employees, Company.Branches, etc.) Is it possible to get an ActiveRecord migration to use anything other than the default "dbo" schema in SQL Server?
...
Hello, i have a set of select inputs representing a users birthday: birthyear, birthmonth and birthday. And i want to validate birthyear like this:
validates_inclusion_of :birthyear, :in => Date.today.year-50..Date.today.year-12
So the user can be at least 12 years but at most 50 years when they are registering.
But my problem is th...
What exactly is the difference in rails between dev and prod environments.
When I develop an application in dev mode, do I have peformance problems, or others if I clone my dev environment on prod?
...
Hi,
In one of my applications on Ruby on Rails, I am using acts_as_taggable plugin. Coding was doing fine and suddenly it started giving following error.
RuntimeError (acts_as_taggable_on_steroids has been moved to github: http://github.com/jviney/acts_as_taggable_on_steroids):
app/models/post.rb:2
app/controllers/post_controller...
I'm fairly new to Ruby on Rails, and I'm attempting to create some fancy CSS buttons using the "sliding doors" technique. I have it almost working, but I feel like there has to be a better way to handle the tags for a link.
The way I'm currently doing it:
<%= link_to '<span>New car</span>', {:action => "new"}, :class=>"button" %>
...
Hi, i have a form where my users can register to my site.
They fill in theirs birthdate in the form: birthyear, birthmonth and birthday.
So i am using Range to create the select in the form like this:
= f.select(:birthmonth, options_for_select((1..12)))
But that doesnt start the single digit numbers with a zero like i want: 01, 02, 03...
hello!
I´d like to test my app with shoulda and machinist. I use the devise authentification gem.
I get following error:
$ ruby unit/page_test.rb
c:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be rem
oved on or after August 2010. Use #req...