ruby-on-rails-2 Questions
6
I am new to rails and I am trying to render a partial within a loop as such.
Here , books is an array eager loaded in controller.
books.each do |book|
<%= render 'books/book', :book => bo...
Gist asked 15/2, 2015 at 8:38
4
I have been following Railscasts episodes of Nested forms and complex forms. During the time of creating multiple model in a single form I was able to edit, update, delete and create records for sa...
Gavra asked 13/2, 2012 at 10:52
9
Solved
I have a default time zone setup for the rails application.
And an instance of the Date object.
How can I get make Date#beginning_of_day to return the beginning of the day in the specified time zo...
Quodlibet asked 24/3, 2011 at 12:33
5
Solved
In the Rails docs there seem to be different default locations for I18N strings, depending if the I18N-lookup was initiated from a view, model / validation, controller, helper, ..., if it's a label...
Mauriciomaurie asked 16/10, 2011 at 20:49
7
Solved
I am trying to run a Rails two app with Ubuntu 10.04 server, sphinx, myql2 version 0.2.7 and percona server 5.5 (Myslql 5.5). mysql2 in irb works ok, I can connect to the db. this rails 2 app is wo...
Taphole asked 10/12, 2011 at 11:50
5
Solved
I have a view from which I make an ajax request to the controller and after the action is successfully completed I initialize the flash.now[:notice]. But after the control goes back to the view. I ...
Crampon asked 20/8, 2011 at 17:27
5
Solved
I'm running a Rails 2.3.5 application and upon running script/server I am shown the following:
./script/../config/../vendor/rails/railties/lib/rails/gem_dependency.rb:21:in `add_frozen_gem_path': ...
Bate asked 11/3, 2013 at 22:26
4
Solved
I have a model MyModel with a serialized attribute a, describing an array of symbols.
This code works :
<% form_for @my_model do |f| %>
<%= f.select :a, MyModel::AS, :multiple => tru...
Columbuscolumbyne asked 9/4, 2013 at 10:31
4
Solved
My model (Bar) already has a reference column, let's call it foo_id and now I need to change foo_id to fooable_id and make it polymorphic.
I figure I have two options:
Create new reference colum...
Lipfert asked 29/8, 2014 at 7:21
5
Solved
I want to check when my object @objectname is not equal to null to show the values of the @objectname else to show that no values found.
I tried this:
<% if (@objectname != null) then %>
...
Colettacolette asked 29/4, 2012 at 11:17
1
What happen if i use ruby version 2.5.1 with rails version 2.3.18 ?
I had rails application built on rails 2.3.18 and ruby 1.9.2p320,
I want to upgrade version of ruby only not the rails is it pos...
Cilice asked 26/7, 2018 at 13:30
11
Solved
I need to query comments made in one day. The field is part of the standard timestamps, is created_at. The selected date is coming from a date_select.
How can I use ActiveRecord to do that?
I nee...
Argufy asked 4/3, 2010 at 18:28
8
Solved
I am using Rails 2.3.5 and in that if I give Model.find(1) and if 1 is not in the database, it returns ActiveRecord error. Should it just be returning nil as in the case of Model.find_by_column('.....
Nuts asked 11/2, 2011 at 7:1
2
Solved
I have the following developement section of my development.yml file:
development:
adapter: postgresql
host: localhost
database: testtb
username: app_user
password: ENV['APP_USER_POSTGRES_PAS...
Hoenack asked 31/12, 2011 at 4:7
2
Solved
I created a new page on an existing controller.
I added 2 action methods on the controller: prompt_user and process_feedback.
So I get to the page via
redirect_to :controller => :users, :ac...
Comradery asked 12/8, 2011 at 18:46
2
While working on Rails 2.3.18 to Rails 3.2.x migration I am facing name issue in type column
Here is the relation that is defined.
app/models/reservation.rb
class Reservation
end
class Reservat...
Behan asked 3/11, 2014 at 7:33
6
I'm monkey-patching a Rails engine with something like:
SomeClass.class_eval do
# ...
end
The first time I hit the web site, on development mode at least, it works, but the second time it's lik...
Hippocrates asked 16/12, 2010 at 12:35
5
Solved
I looked around and couldn't find any answers to this. All answers involved counts that did not use a GROUP BY.
Background:
I have a paginator that will take options for an ActiveRecord.find. It a...
Scutum asked 22/2, 2011 at 1:34
2
Solved
I just upgraded my MacBook Pro to Mavericks and my local Ruby on Rails development environment isn't running straight off the bat, when I visit localhost I see It works! and remembered I needed to ...
Decisive asked 23/10, 2013 at 11:59
2
I am running an application on Rails 2.3.8. I am planning to upgrade it to Rails 4.0 (which is in RC). What will be the easiest way for me to do this? Do I need to first upgrade to Rails 3.x?
Note...
Calyptrogen asked 17/6, 2013 at 6:13
5
Solved
I recently started having to restart my development server every time I change my code. My development.rb file still has this line:
config.cache_classes = false
I tried using the debugger verify ...
Fruiter asked 11/10, 2011 at 0:35
1
I have a legacy Rails application which I want to upgrade to recent Rails and Ruby versions.To start with I am trying to setup the application with Ruby 2.1.2
$ rails -v
Rails 2.3.18
$ ruby -v
ru...
Lole asked 30/7, 2014 at 10:59
3
Solved
I did a query in MySql but is working in Rails and mysql2 gem.
Here is the information:
http://sqlfiddle.com/#!2/9adb8/6
The query is working fine without problems and showing this result:
UN...
Servant asked 11/4, 2014 at 5:22
5
I am trying to run bundle exec rake db:migrate then encountered the following error.
bundle exec rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Exe...
Numbskull asked 12/3, 2013 at 23:21
5
Solved
I've got a model which has a video attached with Paperclip. After it saves I use the saved video to generate a thumbnail. I need to do this after every save, even when a new video hasn't been uploa...
Friendship asked 13/7, 2011 at 15:20
1 Next >
© 2022 - 2024 — McMap. All rights reserved.