Legacy version of the Ruby on Rails web development framework.
Questions tagged [ruby-on-rails-2]
746 questions
0
votes
2 answers
Text field tag search issue
Hello everybody i'm trying to search a column from another table with id hide using text_field_tag
In my view policy_vehicles i have text_field_tag and want to search by motor
My tables
Vehicles
|id| |motor| |plate|
integer …

Charlie Brown
- 219
- 3
- 10
0
votes
2 answers
How can i update my lisbox using ajax?
How can i create an ajax in my search when i select a country it would show me all states that i have in the country selected
I'm trying to create a display when i select country automatically show all the states that has the country selected
My…

Charlie Brown
- 219
- 3
- 10
0
votes
2 answers
Redirect rails app to home page on crash
I want my app to redirect to my home page ie posts#index. It is a rails2 app which I am trying to migrate to rails 3.
def rescue_action_in_public(exception)
flash[:notice] = "There was an error. Please try again." # #{exception}
redirect_to…
0
votes
4 answers
How can I put conditionals in my controller?
I'm having problems when I'm trying to put a condition in params in my controller. This code is inside my controller:
if params[:example] == 1
@table = Model.find(:all,:conditions=>['column_table= ?',params[:example] ] )
else
@table =…

Charlie Brown
- 219
- 3
- 10
0
votes
1 answer
How can i multiple 2 text_field_tags?
I'm trying to create a type of change from DOLARS to Euros
Something like this :
A text_field where it shows my total sum of dolars.
Another text_field where i can type a number.
Another text_field where shows the total sum of dolars * the number…

Charlie Brown
- 219
- 3
- 10
0
votes
3 answers
Sum in a controller issue
I'm getting an error when i'm trying to do a condition and sum my other column
@dolars =Policy.find(:all ,:conditions=>"type_money = '1' ").sum(&:amount_ensure)
My table
Policies
|id| |type_money| |amount_ensure|
integer integer …

Charlie Brown
- 219
- 3
- 10
0
votes
1 answer
Error in select box getting params
I created a search using 2 select box using 2 conditions
A select box for ejecutives
A select box for state of my ejecutive
My error is not getting values when select STATE= 0
But when i select STATE =1 is working
My tables
TABLE EJECUTIVES
…

Charlie Brown
- 219
- 3
- 10
0
votes
1 answer
Rails App Upgrade from 2.3.14 to 4 Errors
I am trying to upgrade my rails 2.3.14 app to rails 4 but experiencing some issues.
In my routes.rb I have the following general rules defined after the more specific ones:
map.connect ':controller/:action/:id'
map.connect…

martincarlin87
- 10,848
- 24
- 98
- 145
0
votes
1 answer
Converting multiple existing classes to inherit from newly created class in rails
At the moment in my rails app I have a few classes that are different products.
e.g. one example is Circuits.
What I want to do is create a new class named Service and have all the individual product models inherit from it.
Previously my circuit.rb…

martincarlin87
- 10,848
- 24
- 98
- 145
0
votes
0 answers
rbenv - Change app ruby version but still looking in older ruby version for gem
Error message is:
MissingSourceFile in QuotesController#accept
no such file to load -- echo_sign
/Users/martin/.rbenv/versions/1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in…

martincarlin87
- 10,848
- 24
- 98
- 145
0
votes
3 answers
Issue with Redirect not functioning in Rail 2
I have this redirection in the middle of my controller so if something isn't there, it will redirect you to a new area of the site if needed. Here is the problem. It is just ignoring the redirect in the code. It looks like this.
if conditions
…

Red
- 2,256
- 5
- 25
- 38
0
votes
2 answers
Ruby on Rails Adobe EchoSign SOAP Request
I am trying to use Ruby on Rails to create a SOAP request to the EchoSign API but I am getting an error saying one of the fields is blank:
{http://dto14.api.echosign}RecipientRole: cannot accept ''
This is the code I am using:
require…

martincarlin87
- 10,848
- 24
- 98
- 145
0
votes
1 answer
Why does this select field appear multiple times in my Rails form?
I've got a Rails application that is using nested forms. Details follow and I tried this solution (Rails 3 Nested Models unknown attribute Error), but for some reason, the field is repeating multiple times instead of listing and saving the options…

KDP
- 634
- 1
- 11
- 31
0
votes
1 answer
Sending Simple Email in Rails
I've read a few questions and http://guides.rubyonrails.org/action_mailer_basics.html on how to send emails with Rails but can't seem to get it to work within the context of my current application.
I had an existing emailer.rb with a couple of…

martincarlin87
- 10,848
- 24
- 98
- 145
0
votes
1 answer
Rails PDFKit Appearance Bug with Bootstrap
I grab my DOM with jQuery and send an AJAX request to create the PDF:
// store html in variable
var html = '' + $('html').html() + '';
// create pdf
$.ajax({
url: '/quotes/generate_pdf',
data: { html : html,…

martincarlin87
- 10,848
- 24
- 98
- 145