ruby-on-rails

Web App that uses Webcam...any Rails plugins/gems?

Hello, I;m a developer looking to make an app similar to chat roulette. I'm pretty comfortable with Ruby on Rails as my platform and would like to program it in that. The downside is I have no idea about how to do anything using webcams. Is there a plugin or gem for rails that integrates webcams easily? Some quick browsing brought m...

Incrementing login_count with Authlogic

I'd like to have the login_count attribute increment each time the user enters my site via explicit login or remember me login. Currently Authlogic only increments login_count per explicit login. Has anyone else done this, or does anyone know where to customize this inside of the plugin? ...

Rails Mongoid version error

Attempting to start the WEBrick server on a Rails 3 / Ruby 1.9.1 with Mongoid errors with: "MongoDB 1.4.0 not supported, please upgrade to 1.6.0 (Mongoid::Errors::UnsupportedVersion)" ... but mongo --version: MongoDB shell version: 1.6.1 Anyone else seen this? Pretty new to Ruby so apologies if I'm asking a stupid questi...

Exception Notification Gem and Rails 3

I'm trying to get this up and running, but I see "uninitialized constant ExceptionNotifier" whenever I start my server. http://github.com/rails/exception_notification In my Gemfile I have gem "exception_notification", :git => "http://github.com/rails/exception_notification.git", :branch => "master" I've tried putting the configurati...

How do I get Rails to exclude some bundled gems from plugin-loading?

I have a Rails application that uses Bundler for dependency management. I've got the following in my Gemfile: # default group: gem 'json' group 'development' do gem 'my_profiler' end group 'test' do gem 'mocha' end group 'deployment' do gem 'foo' end I call Bundler.setup(:default, RAILS_ENV.to_sym) and Bundler.require(:defaul...

Rails -> do something with "updated_at" like "set_primary_key" for the id

have a legacy table with a field "LastModifiedDate", and I want to use that column as my "updated_at" column. Is there any way to tell Rails to use that field? Or, let me rephrase. :) ... How can I tell Rails to use that field? :) Thanks! ...

Billing plugins for rails

Hi there, We want to add billing capabilities to our rails-driven web application. I've come across two plugins that do that - Service Merchant (which is free) and SaaS Rails kit (which costs money). Does someone have some experience with these plugins (or others with the same functionality)? which one would you recommend? Thanks! ...

Email open notification - ruby on rails

If I will send 100 email to the registered user and I want to know if users open email or not How can I do this using Ruby on Rails? Thanks Amit ...

ActiveRecord condition syntax question.

Is there a better way of writing this? Is it possible to do cleanly in one line? conditions = ["category = ?", params[:category]] if params[:category] @events = CalendarEvent.all( :conditions => conditions ) ...

ruby on rails select form helper Null values validation

I have a client table (with fields id, name) and a project table (with fields id, name, client_id). My project model is: class Project < ActiveRecord::Base belongs_to :client end I need to display in one selection list the client name and the project name. In the following code everything is working well, and I get in the selection...

Ruby on Rails API Security

For a recent project a friend of mine and I have been working on, we want to build a RESTful web API for client application usage. I believe that I have a fairly good grasp of the top-down picture after reading this, but am fairly clueless when it comes to security issues. I know of OAuth and plan on implementing it, but are there any o...

Should I host gems in GitHub or RubyGems?

I've read that RubyGems is de-facto hosting for gems. I host all my Rails projects on GitHub. So my questions are: Are there any reasons for hosting my gems on GitHub and not RubyGems? Does RubyGems have private repositories like GitHub? I've read that jeweler is nice for creating gem skeleton. On their webpage it sounds like it uplo...

unterminated string literal when loading text through ajax

This seems to be a common problem among coders from different languages. I'm using jQuery to pull AJAX text into a screen, but firebug reports an unterminated string literal with a worthless example : $("#content").html("<div class=\'grid_...g\'><\/div>\n<p>Cold Seafood Platters\n I double checked in my AJAX example text if there w...

Ruby on Rails: How do I get observe_form to wait until two fields are filled before updating?

<%= observe_form :date_range_filter, :frequency=>0.5, :update=>'perfomance', :url=>{:action=>'filter_date_range'}, :before => "startLoad('perfomance');", :complete => "stopLoad('perfomance');" %> I have two fields: date_after, and date_before how do I get the observer to wait till both have dat...

Use Capistrano for Rake tasks?

Is Capistrano only used for deploying Rails apps? Basically I want a scripting framework to handle all server/client scripting for me. Examples: Updating Ubuntu, installing gems with dependencies etc. Creating a new Rails app, Git initialize it and commit, create Heroku project and upload the app. Automatize basic file/folder operati...

Ruby on Rails: how do you write a find statement that sums up a bunch of values if an object belongs to another object?

Lets say Users have BankAccounts which have a balance value. So, how do I generate an array that Users and the total value of all their BankAccounts' values added together? ...

Override Rails updated_at attribute

Hi, I would like to modify updated_at attribute so that every time record is updated it would only show date and hours while hours and minutes being zeros. Instead of 2010-08-13 11:04:12, there would be 2010-08-13 11:00:00. What is the most rational way to do this in Rails 2.3? Update The reason why I want to do what I have asked is ...

Rails + ActiveScaffold -> set_default_options

I can't seem to set default options at the ApplicationController level. I can do it just fine at the Controller level, but I want to be able to set some defaults here. This is the code that I'm using (for example): ActiveScaffold.set_defaults do |config| config.update.link.label = "" config.list.per_page = 15 end Any help wo...

Dynamically adding items to a select list in Ruby On Rails using Ajax (again)

OK. So I am so close . . . and so frustrated. Please help. Here is are the two drop down lists which are part of the products/new page <p> <%= f.label :category_id %>: <%= f.select("category", Category.find(:all).collect {|c|[c.name, c.id]})%> </p> <%= observe_field :product_category, :url => {:controller => 'products', :action =...

Nested resources, Ajax request

There are two models: Exams and Resources. Every each exam could has many Resources Routes.rb resources :exams do resources :resources end I want to get asynchronously all resources belongs to particular Exam. That should be realising in exam controller, yes? But there's another problem, how should I send ajax request? I need ...