ruby-on-rails

Acts-as-readable Rails plugin Issue

I'm using Intridea's Acts as Readable Rails plugin for a messaging system I'm currently building. I've defined my message class accordingly: class Post < ActiveRecord::Base acts-as-readable end And everything seems to be working according to plan, but when trying to execute to show unread messages in my message view, I'm running int...

Best Solution For Authentication in Ruby on Rails

I'm looking for a pre-built solution I can use in my RoR application. I'm ideally looking for something similar to the ASP.NET Forms authentication that provides email validation, sign-up controls, and allows users to reset their passwords. Oh yeah, and easily allows me to pull the user that is currently logged into the application. I...

WYSIWYG editor gem for Rails?

Is there a good ruby gem for a WYSIWYG editor that will easily work with a rails app? ...

How to represent cross-model information in MVC?

I have an application, built using MVC, that produces a view which delivers summary information across a number of models. Further to that, some calculations are performed across the different sets of data. There's no clear single model (that maps to a table at least) that seems to make sense as the starting point for this, so the vario...

Is there a rake task for backing up the data in your database?

Is there a rake task for backing up the data in your database? I already have my schema backed up, but I want to make a backup of the data. It's a small MySQL database. ...

How do I gracefully shut down a Mongrel web server

My RubyOnRails app is set up with the usual pack of mongrels behind Apache configuration. We've noticed that our Mongrel web server memory usage can grow quite large on certain operations and we'd really like to be able to dynamically do a graceful restart of selected Mongrel processes at any time. However, for reasons I won't go into h...

Ruby / Rails pre-epoch dates on windows

Working with dates in ruby and rails on windows, having problems with pre-epoch dates (before 1970) throwing out of range exceptions. Tried using both Time and DateTime objects but continuing to have the same problems. ...

How do I support SSL Client Certificate authentication?

I want to do what myopenid does -- once you've logged, you can click a button that generates you an SSL certificate; the browser then downloads this certificate and stores it. When you later go back to yourid.myopenid.com, your browser can use its stored certificate for authentication so you don't ever need a password. So my questions ...

XML => HTML with Hpricot and Rails

I've never worked with web services and rails, and obviously this is something I need to learn. I've chosen to use hpricot because it looks great. Anyway, _why's been nice enough to provide the following example on the hpricot website: #!ruby require 'hpricot' require 'open-uri' # load the RedHanded home page doc = Hpricot(open("ht...

Is there a way to combine named scopes into a new named scope?

I have class Foo < ActiveRecord::Base named_scope :a, lambda { |a| :conditions => { :a => a } } named_scope :b, lambda { |b| :conditions => { :b => b } } end I'd like class Foo < ActiveRecord::Base named_scope :ab, lambda { |a,b| :conditions => { :a => a, :b => b } } end but I'd prefer to do it in a DRY fashion. I can get th...

Deploying a Git subdirectory in Capistrano

My master branch layout is like this: / <-- top level /client <-desktop client source files /server <- Rails app What I'd like to do is only pull down the /server directory in my deploy.rb, but I can't seem to find any way to do that. The /client directory is huge, so setting up a hook to copy /server to / won't work very well, it ne...

Rails requires RubyGems >= 0.9.4. Please install RubyGems

I'm deploying to Ubuntu slice on slicehost, using Rails 2.1.0 (from gem) If I try mongrel_rails start or script/server I get error: Rails requires RubyGems >= 0.9.4. Please install RubyGems When I type gem-v i have 1.2.0. Any quick tips on what to look at to fix? ...

Problems passing special chars with observe_field

I am working on a rails project. Using the tag observe_field, I am taking text typed into a text area, processing it in a control, and displaying the result in a div (very similar to the preview in stack overflow). Everything works fine until I type certain special chars. ? => causes the variable not to be found in the params object (p...

How to profile a rails controller action

What is the best way to profile a controller action in Ruby on Rails. Currently I am using the brute-force method of throwing in "puts Time.now" calls between what I think will be a bottleneck. But that feels really, really dirty. There has got to be a better way. ...

How to program user preferences

I'm using Ruby on Rails for an internal site. Different users of the site have access to a wide variety of data and highly disparate perspectives of the data. Within those different classes of users, there needs to be levels of access. Within the levels of access I need to be able to add features from other classes of users. In the rele...

How would you test observers with rSpec in a Ruby on Rails application?

Suppose you have an ActiveRecord::Observer in one of your Ruby on Rails applications - how do you test this observer with rSpec? ...

Accessing Sharepoint from outside the WebUI

Is it possible to access the database backend of a sharepoint server? My company uses Sharepoint to store data and pictures of various assets. Ideally I would be able to access the data and display it in my application to allow users both methods of access. Before I go talk to the IT department I would like to find out if this is even p...

Is it possible to call Javascript's onsubmit event programatically on a form?

In Ruby on Rails, I'm attempting to update the innerHTML of a div tag using the form_remote_tag helper. This update happens whenever an associated select tag receives an onchange event. The problem is, <select onchange="this.form.submit();">; doesn't work. Nor does document.forms[0].submit(). The only way to get the onsubmit code gen...

Install the Radrails plugin for Aptana Studio offline

I downloaded and installed the Aptana Studio free version. But apparently, to install the Radrails plugin for ruby on rails development you have to connect to the internet. I don't have internet on my machine right now. So is there a way I could download the installer from another machine and copy it over my existing Aptana installation?...

Is there anyway to run ruby on rails applications on a windows box?

I'm looking to run Redmine, a Ruby on Rails app, on a vps windows box. The only thing I can really think of is running a virtual linux machine and hosting it from there. If that is my only option, am I going to run into problems running a virtual machine inside of a virtual machine? Also, this will be an internal app, so performance i...