ruby-on-rails

How to create a session in PHP when there is a session on the same domain in Rails?

I have a Rails app on a subdomain - xyz.domain.com, and a PHP app on another subdomain - abc.domain.com When a user is logged into the Rails app, I would like to give them a session so that I can log certain events about that user in the PHP app but in the same database of the Rails app. I would essentially just expose an API that requ...

Net::SMTPFatalError in rails 2.3.4

I'm getting the following error when trying to send email on rails 2.3.4(it worked on 2.3.2) using action_mailer_tls plugin: Net::SMTPFatalError in UsersController#create 555 5.5.2 Syntax error. w3sm66205164ybi.9 C:/Program Files (x86)/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/1.8/net/smtp.rb:930:in `check_response' C:/Program Files (x...

Which must be the gems directory?

Some weeks ago I upgraded my NetBeans version from 6.7 to 6.8. Yesterday, while trying to solve some issue, I updated the gems' versions and suddenly the app stop working, throwing me the error message: Missing the Rails 2.3.4 gem. Please gem install -v=2.3.4 rails, update your RAILS_GEM_VERSION setting in config/environment.r...

Jquery AJAX: How to display the Flash error message when validation on the server side fails?

I am using the Jquery form plugin to submit the form via ajax. I have set up validations on the server side in my models. Now when the validation fails i want to display the same flash[:error] message to the user using ajax. If the validation succeeds I can display the flash[:notice] as it is available after the request is completed. How...

Error on rake command

Hi, Have you an idea about this error message when i run the rake db:migrate command under Aptana ? rake aborted! NoMethodError: undefined method `ord' for 0:Fixnum: SET SQL_AUTO_IS_NULL=0 Thanks Here My Config : Windows XP PRO SP2 Wamp 2.0 Aptana 2.0.4 RubyGems 1.3.5 Ruby 1.8.6 ...

Mongomapper - unit testing with shoulda on rails 2.3.5

I'm trying to implement shoulda unit tests on a rails 2.3.5 app using mongomapper. So far I've: Configured a rails app that uses mongomapper (the app works) Added shoulda to my gems, and installed it with rake gems:install Added config.frameworks -= [ :active_record, :active_resource ] to config/environment.rb so ActiveRecord isn't us...

using i18n with rails 3 problem

Hi! I've got some form for user registration and want to localize it via locales yml files. Especially errors from validations. For example, locale file: tr: activerecord: errors: models: user: attributes: name: blank: "can't be blank" it will return: name can't be blank in er...

JQuery date picker does not firing in ajax page using Rails

Hi Here I have using datepicker from JQueryUI in my public/javascript folder as effects,prototype,control,dragdrop js files. in my public folder contains jqueryui development buddle. (css,js,development-bundle) in layout/application.rhtml <%= stylesheet_link_tag 'application' %> <%=javascript_include_tag :defaults%> <%= st...

Starting a Rails development server that is publicly accessible

Is there a way to start a Rails 3 development server (rails server) that is not bound to a specific IP address? I'd like for others working on a project with me to be able to use the application from remote locations. ...

Rails controller not rendering correct view when form is force-submitted by Javascript

I'm using Rails with jQuery, and I'm working on a page for a simple site that prints each record to a table. The only editable field for each record is a checkbox. My goal is that every time a checkbox is changed, an ajax request updates that boolean attribute for the record (i.e., no submit button). My view code: <td> <% form_remote...

Obtaining ActiveRecords if NOT nil

I would like to be able to gather all records in a table where the user_id is not null. This is what I have but it doesn't seem to be working (even though I've had it working in a seperate project): named_scope :all_registered, :conditions => ["user_id != ?", nil] ...

How to triage this MySQL duplicate entry error after running Rails migration?

I get the following error when I try to run this migration: == AddUniquenessConstraintOnAwards: migrating ================================ -- add_index(:awards, [:badge_id, :game_week_id], {:unique=>true, :name=>:game_badge_index}) rake aborted! An error has occurred, all later migrations canceled: Mysql::Error: Duplicate entry '35-81...

Sending and receiving IM messages via controller in Rails

Hi, I need a way to handle XMPP communication in my Rails app. My requirements are: Keep an instance of XMPP client running and logged in as one specific user (my bot user) Trigger an event from a controller to send a message and wait for a reply. The message is sent to another machine equipped with a bot so that the reply is sup...

Using devise with oauth in a rails application

Hi, does anybody know a good tutorial for getting oauth working with devise? I want to use it for a Twitter login and posts data to the users twitter timeline. thx, tux. ...

installed gems activated before frozen gems?

We're using gems:unpack to ensure gem version consistency across environments. However, we're running into: can't activate , already activated [GEM-VERSION] Is this because installed gems take precedence over frozen ones? Is it possible to have frozen gems activate first? Advice on ways to keep gems consistent welcome. ...

Rails: Serializing objects in a database?

I'm looking for some general guidance on serializing objects in a database. What are serialized objects? What are some best-practice scenarios for serializing objects in a DB? What attributes do you use when creating the column in the DB so you can use a serialized object? How to save a serialized object? And how to access the serializ...

will_paginate and facebook/facebooker

I'm using will_paginate in a facebook application and when i click on the next button or a page number i get the url below. This is fine if everyone was using safari, but it breaks on ie and ff. That and people can't copy and paste the url to others. Anyone have any ideas how to fix this. http://apps.facebook.com/application/users/4...

Rails complex routing, easier named routes helpers

I have a named route like the following: map.with_options :path_prefix => '/:username', :controller => 'questions' do |q| q.question '/:id', :action => 'show', :conditions => { :method => :get } end Now to generate a URL to a specific question I have to write question_path( :id => @question.id, :username => @question.user.usernam...

Permutation on Rails Routes

I currently have an application that for a set of parameters (location, category, budget, ...) a user can enter a "pretty" URL like: /location/canada/ontario /category/primary /budget/small Resulting in the respective parameters: params[:country] == 'canada' and params[:region] == 'ontario' params[:category] == 'primary' par...

Rails, Is there any way in my view use link_to to grab the contents of a specific field and place it in a ruby variable?

Basically I am trying to capture the value of the form field before it is saved to the database. Then I intend to use that value in my controller to update a specific field in the database, using @taskforms.update_attribute('notes', $notes) I need to do this because I know of no other way to update that that does not require t...