Questions tagged [ruby-on-rails-2]

Legacy version of the Ruby on Rails web development framework.

746 questions
0
votes
1 answer

How to use Rails, form_for, and Bootstrap to generate properly nested

I've inherited some old Rails 2.3 code. I want to use the standard rails <%= form_for %> and <%= remote_form_for %> helpers. I also want to use Twitter Bootstrap, and have the
0
votes
1 answer

Box API: Is it possible to list the groups a user belongs to?

My question is simple, I'm trying to build a system to manage Users and Groups for each User, so in order to add a user to a group (or remove the user from a group) I need to know which groups this user belongs to in both sides. Otherwise I have to…
LuisVM
  • 2,763
  • 3
  • 20
  • 22
0
votes
1 answer

Rails splited code not working

I am using rails 2.3. In my application it uses val = Party.find(:all, :conditions => [" type in ('Physician') || id in (?)",PartyLabel.find(:all,:conditions=>"label_id=#{Label.find_by_label("Can Schedule").id}").collect{|p| p.party_id if…
Bathakarai
  • 1,517
  • 6
  • 23
  • 39
0
votes
1 answer

Query execute in N+1 times

In my application i am using phy = Physician.find(:all, :include => {:clinician_affiliations => :provider_organization}, :with_disabled => true).select{|physician| not physician.provider_organizations.blank? }.collect{|enum|…
Bathakarai
  • 1,517
  • 6
  • 23
  • 39
0
votes
1 answer

Trouble deleting ActiveRecord object, foreign key constraint fails

Rails 2.3 What I've tried... >> Import::Subscription.all(:conditions => ["account_id = ?", "44"]).destroy_all NoMethodError: undefined method 'destroy_all' for # >> Import::Subscription.all(:conditions => ["account_id = ?",…
cluv
  • 620
  • 6
  • 11
0
votes
0 answers

Rails 2 - Problems running project

I work with JRuby and Rails 3.2 but now I've found I got to work on a project on Rails 2. I know some basic things about Rails 2 like the command jruby ./script/server to start the server instead of rails s but when we start talking about gems in…
M.Octavio
  • 1,780
  • 2
  • 25
  • 39
0
votes
1 answer

Can I save cookie values with other data during form process in Rails?

I have set three cookies in my Rails controller for some information about the visitor when they land on the site. When they submit a form, I need the values of these three cookies to be saved in the database table along with the other form data. I…
lolthai
  • 59
  • 1
  • 8
0
votes
1 answer

routing to a static .md page in /public (ruby on rails 2.3.5)

this question was asked before, but the answer was for ruby on rails 3.0+ Basically I want to put my wiki pages (ie .md pages) inside my public folder in my 2.3.5 ruby on rails project. and I want users to access the home of the wiki page when they…
abbood
  • 23,101
  • 16
  • 132
  • 246
0
votes
1 answer

Heroku + Rails + GeoIp = uninitialized constant GeoIP error

I'm trying to deploy my old website to the Heroku. Everything goes well, it starts, but when I access it through a web browser i get NameError (uninitialized constant ApplicantsController::GeoIP): I'm using Rails 2.3.18 (my website is very simple…
mat
  • 337
  • 1
  • 9
0
votes
1 answer

On Rails 2.3.8 paragraph tag,

, inserted automatically

I just want to do like this.

so, on rails 2.8.3 I wrote like this.

<%- form_tag blabla -%><%- end -%> <%- form_tag blabla -%><%- end -%>

but the result is like this.

Hiroaki Machida
  • 1,060
  • 2
  • 12
  • 23
0
votes
1 answer

Queries for both 2.x and 3.x versions of Rails

I'm working on library which should support 2.x and 3.x versions of Rails. In this library I'm queering some data from database. Is there already built gem which can help to write query once and it will work on either Rails 2 or Rails 3?
megas
  • 21,401
  • 12
  • 79
  • 130
0
votes
1 answer

Webservice POST not displaying requested parameters using rest client in rails 2.3.8

I have headers set as Accept application/json and content-type application/json for my POST webservice. Follwing are the requested parameters: { "OccupantID": 162921, "BuildingID": 13294, "QuizID": 397, "Score": 3, "Result": "fail" …
Chitrank Samaiya
  • 841
  • 10
  • 20
0
votes
1 answer

Rails console: attribute returns false, but is shown correctly with to_yaml

maybe I'm missing something, but I did research and could not find out why this is behaving like it does. I'm working with Rails 2.3.16 and ruby 1.9.3, backed by a huge ibm-db2. Lets assume I have a class Foo (I tried to build a short example…
0
votes
1 answer

Best way to migrate table data to other table

Considering 4 models (very simplified) class Group1 << AR::Base has_many group1_items end class Group2 << AR::Base has_many group2_items end class GroupItem << AR::Base belongs_to :group1 belongs_to :thing end class Group2Item << AR::Base …
pierallard
  • 3,326
  • 3
  • 21
  • 48
0
votes
1 answer

undefined method `end_with?' for "rake aborted!":String (NoMethodError)

I have been facing problem running rake task/commands whenever I type rake db:migrate or rake -T, it is displaying error saying undefined method `end_with?' for "rake aborted!":String (NoMethodError).Using ruby186, rails238 and gem version…
Chitrank Samaiya
  • 841
  • 10
  • 20