Questions tagged [ruby-on-rails-2]

Legacy version of the Ruby on Rails web development framework.

746 questions
0
votes
1 answer

Adding rails 3 form helpers to rails 2

I would like to add the number_field form helper that exists in rails 3 to my rails 2.3.15 app, but i'm having trouble extending the module. These are the methods I need from rails 3 class InstanceTag def to_number_field_tag(field_type, options…
mastaBlasta
  • 5,700
  • 1
  • 24
  • 26
0
votes
1 answer

I have somehow broken my Rails app - the dreaded NoMethod Error

The error message is NoMethodError in Circuit#update undefined method 'network_address' for nil:NilClass and related to this line in my view: <%= logical_interface.subnet.network_address %> Everything was working perfectly earlier and now…
martincarlin87
  • 10,848
  • 24
  • 98
  • 145
0
votes
1 answer

Can't access foreign key property in Rails

I have two classes - pop_vlans and logical_interfaces defined as follows: logical_interface.rb class LogicalInterface < ActiveRecord::Base has_many :pop_vlans end pop_vlans.rb class PopVlan < ActiveRecord::Base self.table_name = 'pop_vlans' …
martincarlin87
  • 10,848
  • 24
  • 98
  • 145
0
votes
2 answers

How to find which foreign keys are referenced

I have two classes - logical_interfaces and pop_vlans with a one-to-one relationship. In the logical_interfaces table the foreign key is vlan_id which relates to the id column in pop_vlans. In my controller I get a list of vlan_numbers (stored in…
martincarlin87
  • 10,848
  • 24
  • 98
  • 145
0
votes
1 answer

ApplicationController layout is being overriden by inherited classes? Ruby on Rails 2

I am developing a Rails 2 application and only have the need for one layout template for my multiple controllers so I created one application.html.erb to be used and put layout 'application' into my ApplicationController (which all the controllers…
Pori
  • 696
  • 3
  • 7
  • 18
0
votes
1 answer

Rails DateTime Comparison Bug

I have a ticket class which has the default rails column of updated_at so while someone is on the ticket page making an update I am polling the database to see if someone else has changed it at the same time. In the view if I do this it…
martincarlin87
  • 10,848
  • 24
  • 98
  • 145
0
votes
1 answer

discard_day and month not working rails 2.3.5

3.5 while doing an application . my :discard_day and month not working it still showing as eg:2013-01-01 . in my db im using "date" datatype <%= v.date_select :year, :discard_day => true, :discard_month => true, :order => [:year], :start_year =>…
Navin
  • 543
  • 8
  • 27
0
votes
1 answer

how to deploy rails project with RAILS_GEM_VERSION = '2.3.8'

I want to run the rails project having RAILS_GEM_VERSION = '2.3.8' I have some of my running project with rails version is 3.2.11....how do I proceede
Niket
  • 1,105
  • 12
  • 15
0
votes
2 answers

Sorting! Each blocks, attributes Ruby 1.8.7, Rails 2.3.15,

I have an app that manages images associated with buses. My problem is that I can't figure out how to sort an each block by a particular BusImage attribute, :thumb_order instead of the BusImage id. A Bus has many BusImages. The instance variables…
Alaric
  • 229
  • 1
  • 12
0
votes
1 answer

RuntimeError: ERROR Mrelation "tablename" does not exist

Rails - 2.3.8 Database - Postgres(9.2) Active record query is not able to generate tablename in double quotes ie # this ran fine Table.find_by_sql('Select * from "Table" Limit 1') Sql generated - Select * from "Table" Limit 1 But…
0
votes
3 answers

Find result from joining a table in rails :conditions part

Currently the attachments are searched based on attachment_file_name, tags and employee_id, I would like to search based on Employee name as well, how can I go with it? Two models must be used. Employee - which has name of…
Nithin
  • 3,679
  • 3
  • 30
  • 55
0
votes
2 answers

private method `split' called for nil:NilClass

I'm using the sitemap_generator (https://github.com/kjvarga/sitemap_generator) gem and seem to have my code working fine in the development environment but when I try to run it in production I get the following error: private method `split' called…
Kerry Falk
  • 3
  • 1
  • 3
0
votes
5 answers

how to start Rails 2 app (Ruby 1.8.3, Rails 2.3.8)

I am having one file intello erp,ruby version is 1.8.3 and rails 2.3.8 When I said rails s why it is not starting server?it is showing given below.help me exists exists app/controllers exists app/helpers exists …
Ashwini K
  • 95
  • 2
  • 7
0
votes
2 answers

Respond_to does not call the right format

Rails 2.3.18 I have a Answer controller with an index function like this : def index respond_to do |format| format.js { } format.all { redirect_to ... } end end I have a anwers/index.js.erb associated to this index action, for :js…
pierallard
  • 3,326
  • 3
  • 21
  • 48
0
votes
2 answers

Rails migration error - Name can't be blank

I am using rails 2.x version. Am using mysql 5.0 database for back end process. I faced a migration error when i did the following steps. Get the application code from github. Run schema:create, load and seed process After that add some data in the…