Questions tagged [ruby-on-rails-2]

Legacy version of the Ruby on Rails web development framework.

746 questions
0
votes
3 answers

rails 2.3 will_paginate 2.3.16 undefined method `paginate' for #

I've found a lot of links regarding this problem googling. but nevertheless I still get this error after implementing those fixes. so my gemfile gem 'will_paginate', '~> 2.3.16' environment file config.gem 'will_paginate', :version => '~>…
Elmor
  • 4,775
  • 6
  • 38
  • 70
0
votes
1 answer

How can i count a column in my view?

I did an app to show a column from another table but i want to know how to count the results instead of showing information Here my tables |policies| |id| |num_policy| 1 11111 2 22222 |insurances| |id| |id_policy|…
Carlos Morales
  • 1,137
  • 3
  • 15
  • 38
0
votes
1 answer

Showing a column in relationship issue

I did an app to show a column from another table but is not working Here my tables |policies| |id| |num_policy| |insurances| |id| |id_policy| |net_insurance| |insurance_financing| |id| |id_ensurance| |number| This is my…
Carlos Morales
  • 1,137
  • 3
  • 15
  • 38
0
votes
1 answer

How can i count a column doing a condition?

i'm trying to count a column using conditions Tables select* from policies |policies| |id| |client_id| |expiration_date 1 1 2013-10-10 2 1 2013-10-10 3 2 2013-10-10 |clients| |id| |name| 1 ABC …
Carlos Morales
  • 1,137
  • 3
  • 15
  • 38
0
votes
1 answer

Show information from table in relationship issue

I did an app to show a column from another table but is not working Here my tables |policies| |id| |num_policy| |insurances| |id| |id_policy| |net_insurance| This is my controller class PolicyController < ApplicationController def…
Carlos Morales
  • 1,137
  • 3
  • 15
  • 38
0
votes
2 answers

Sum 2 columns a value with array

Hello everybody. I'm trying to sum 2 columns(amount_ensure and vehicle_Value) from different tables in my view TABLES |POLICIES| |id| |amount_ensure| |POLICY_VEHICLES| |id| |policy_id| |VEHICLES| |Id| |vehicle_value| Here is my…
Carlos Morales
  • 1,137
  • 3
  • 15
  • 38
0
votes
1 answer

Passing local variable to a partial in rails 2.x

I have the following method in my controller: def update_fees_collection_dates_voucher @batch = Batch.find(params[:batch_id]) @dates = @batch.fee_collection_dates render :update do |page| page.replace_html…
haanimasood
  • 77
  • 1
  • 1
  • 5
0
votes
1 answer

Search condition sphinx issue

I did a search using the gem "thinking_sphinx", version => '1.4.14'. I'm trying to create conditional in my table policy where policies.deleted= 0 Here is my controller class PolicyController < ApplicationController def search @policies…
Carlos Morales
  • 1,137
  • 3
  • 15
  • 38
0
votes
2 answers

Rails 2.1 belongs_to primary key

I have a basic database with a structure like this. products ------------------ id serial order ------------------ id product_serial Unfortunately, I cannot change structure of the DB. I looked at the docs for Rails 2.1 and it said I could setup a…
Dan Grahn
  • 9,044
  • 4
  • 37
  • 74
0
votes
2 answers

How can I count and select at the same time?

I'm trying to do a select and count at the same time. This is my code: @count = Policy.find(:all,:conditions=>['state= 0 AND deleted = 0'] ####i want to count all the policies that has 1 client by document @count = Policy.count(:joins =>…
Carlos Morales
  • 1,137
  • 3
  • 15
  • 38
0
votes
1 answer

gem uninstall rake-10.1.0 error (couldnt remove from gem list and im trying to use rake-0.8.3)

gem list shows rake (10.1.0, 0.8.3),trying to uninstall rake 10.1.0 by gem uninstall rake -v '10.1.0' getting ..INFO: gem "rake" is not installed showing rake 10.1.0 in gem list...my goal is to use rake-0.8.3 So any one can help (using…
praaveen
  • 5
  • 5
0
votes
1 answer

Rails 2.3.x: Is it possible to call a controller's action from Initializer?

I am using rails 2.3.8 . I need to call a controllers action from a initializer. I found this snippet in rails 3 usin Proc OmniAuth.config.on_failure = Proc.new do |env| UserSessionsController.action(:omniauth_failure).call(env) end If…
jithendhir92
  • 145
  • 1
  • 6
0
votes
2 answers

Multiple Text Search issue

I created a search application using 2 columns (name and lastname) but is not working when a person has more than 2 names. How can i search a person with 3 names and lastname? Controller: class PersonController < ApplicationController def search …
Carlos Morales
  • 1,137
  • 3
  • 15
  • 38
0
votes
1 answer

Rails Model Callback Not Working (Creating new instance of a different class)

In my circuit.rb class I have the following class Circuit < ActiveRecord::Base after_create :create_service def create_service # create service record service = Service.new :service_type => 'Circuit', :child_id => self.id,…
martincarlin87
  • 10,848
  • 24
  • 98
  • 145
0
votes
1 answer

Conditional issue using relationship

I'm trying to search a column from another table using three tables in relationship. In my view policy_vehicles I have a text_field_tag and want to search by "raz_soc". My tables are: Policy_vehicles |id| |policy_id| integer …
Charlie Brown
  • 219
  • 3
  • 10