ruby-on-rails

What are the disadvantages of using Ruby on Rails versus ASP.NET MVC to build a social website?

I ask specifically what the disadvantages are because it's easy to find and read about the advantages of using RoR instead of ASP.NET MVC. But I'd like to have a better understanding of the disadvantages so I have a better idea of what to expect when I begin building a social website using RoR. Thanks so much in advance for your wisdom!...

rails has_many through with independent through table

I have a User model, Person model and Company model. a User has many companies through Person and vice versa. But i would like to be able to populate People and Companies that are not tied to Users that can be tied later. class User < ActiveRecord::Base attr_accessible :name has_many :people has_many :companies, :through => :peo...

Devise logged in root route rails 3

Heyya guys. So i thought about this coolio idea, if you are logged in then you get some sort of dashboard, else you get an information/login/sign up page.. So how do i do that.. I mostly wants to do this in Routes = not something like def index if current_user.present? render :action => 'logged_in' else render :action => ...

Ruby rails request question

/facebook/promo/#access_token=162592277090170%7C2.yCch3otjrdit_rgBFS6F0A__.3600.1285369200-727781553%7CtugQmoO0bRiadumHVQrrSiPRD9Y&expires_in=7174 This is the request facebook calls back. How can I parse the access_token ffrom the url? I could not find any way to get the access_token value. Please aware that it is not a reqular paramet...

Sometimes my request comes in as HTML and other times as TEXT/*. Why?

I have an AJAX upload action for my Rails app. Sometimes it comes in as: Started POST "/products/temp_upload" for 63.148.78.244 at Fri Sep 24 21:34:27 +0000 2010 Processing by ProductsController#temp_upload as HTML And everything runs smoothly. Other times it comes in as: Started POST "/products/temp_upload" for 63.148.78.244 at ...

What do i need to know to contribute to Rails?

I am a user of Ruby on Rails framework and am thinking of giving back to it by contributing to the code. I understand that there is a need for thorough understanding of the Ruby language concept to contribute? Ive cloned the project, looked at the code, check out the tickets and have no clue how to begin? From what i see the Rails Framew...

Shoulda: unknown error with validates_each

I'm having an awful time trying to understand what my validation method is having trouble with. I installed shoulda and when I tried to use it it errors out with a strange undefined method NoMethodError: undefined method '[]' for false:FalseClass which is very odd. I narrowed it down to this piece of offending code: validates_each :na...

Rails UJS rendering js.erb template in IE

I have a RoR app running rails 2.3.8 which makes use of the Rails 3 style UJS to bind data-remote forms instead of using form_for_remote, the controller responds with a js.erb file from the server. Works beautifully in FF, Chrome, and Safari, but when run in IE it prompts you to save a file and does not execute the JS. My research so f...

Changing home_path redirection - Ruby on Rails - Lovdbyless

Hi, I'm using Rails 2.3.5 and have been having a problem with redirecting a user back to the sign-up page. Tried changing home_path to my sign-up page path in accounts_controller.rb but the redirect still looks in public/signup. accounts_controller.rb - signup def signup redirect_to("http://mysite.me/signup") and return if @u @user =...

In Ruby on Rails, when a before_filter is used, then the local variables need to become instance variables?

If we have a before filter that's called initialize to initialize common variables, then those variables must be made into instance variables? Are there alternative ways of doing it? Update: The situation is to validate some URL params, and set them. This used to be in one action, so everything can be done using local variables. But ...

Ruby gems won't load even though installed

I know there's similar questions on SO, but none of them solve my problem... The gist of it is that I can't get gems to load on a clean Ruby 1.9.1 install on Ubuntu 10.04: :~/$ irb irb(main):001:0> require 'rubygems' => false irb(main):002:0> require 'cassandra' LoadError: no such file to load -- cassandra from (irb):1:in 'require'...

How can I use a cloned copy of rails 3 to test with a new/existing app?

I want to implement a feature in rails but I'd like to test it with a rails application. If my (git) cloned copy is sitting in ~/home/username/code/rails then how can I create a new rails app that references that code instead of my installed rails gem? ...

rails tutorial literred with hard coded error messages, how to localize?

Just going through the rails tutorial, and I noticed that the error messages are all hard coded in the controller actions etc. What is the pattern to pull these from a localized resource file? (I'm on chapter 9 so far) ...

ruby on rails mongrel on local network

Okay so I have instant rails running on my windows laptop, I thought if I have the mongrel server running (ruby script/server), then I should be able to access the application using my laptops external ip address. (Ex. 172.17.104.100:3000/fontpage) However, when I try it from my roommates computer I cannot access the app. Any suggestion...

Change scope of :new action in Rails3 routes to :member

I need to match /entries/slug-here/new and send it to EntriesController#new Tried following ways, both didn't work :( resources :entries do member do get :new end end resources :entries do get :new, :on => :member end Temporary hardcoded paths with bunch of matches, but it looks ugly >.< UPDATED: Same with create method ...

Authentication failing on production server

On my development machine I can login fine, but once on production, authentication fails for the base user created in the migration. I can reset my password and upon doing so I am auto logged in, but when I logout and try to login again using the newly entered password, once again it tells my I have a bad email and/or password. An...

How do I update a :has_one value through link_to_remote?

I want to be able to change value for the :status_contact for the model Contact (has_one :status_contact Here is the snippet with the link_to_remote: <%= link_to_remote "Responded - Positive", :url => contacts_url(@contact, :status => 'positive response'), :update => "status" %> <span id="status"></s...

How to create video,audio chat system in rails,ruby or using node

I want to build video/audio chat application for my one of the social apps.Is there any library are available in java or ruby or node.js that can help us to build audio/video chat application. Or any suggestion/technical article that help us to build video chat application. ...

For Ruby on Rails, how do you switch to a new and empty DB with the same DBMS or a different DBMS?

If no need to migrate the data, it seems that we can just edit database.yml development: adapter: mysql database: myapp_development host: localhost username: root password: encoding: utf8 1) to use a brand new db with 0 data, just change the 3rd line to: database: myapp_development_02 and then do a rake db:create and ra...

Simply returning success or failure from ajax call in rails

I have a little ajax call that calls rails: $.ajax({ type: "POST", url: '...', data: ({ ... }), success: function(response, status) { console.log(status); } }); In the rails controller I'm simply deleting an entry from the database, and I simply...