6,957 questions
0
votes
1
answer
50
views
(Ruby on Rails validates_confirmation_of) How to switch error message to the confirmation field?
In Ruby on Rails 3.2, I am trying to validate password confirmation with this:
validates_confirmation_of :password
Rails will add the validation error to the :password field. How do I make the ...
0
votes
2
answers
856
views
Update record in before_destroy and prevent its destruction
I am using Rails 3.2, Ruby 1.9.3.
I need to prevent a record from being destroyed and update it in the before_destroy callback.
Given two classes with the following associations
class Course:
...
0
votes
1
answer
587
views
Ruby on Rails: pass query parameters hash with key but nil value
In Ruby on Rails, my current url has a query parameter of ?hello. Since the request.query_parameters hash will be {:hello=>nil}, how do I pass this with link_to? Rails seems to drop any query ...
0
votes
1
answer
84
views
Access value from multidimensional Hash rails
I have to access the id and other important information of each operator.
The structure of given data is:
{:items=>
[{:id=>"868f136b-ec4e-4794-a3a9-a70d4b83ab38",
:clientId=>&...
1
vote
3
answers
2k
views
Mysql2 error in starting rails server in mac m1
I have installed mysql2 in mac m1 using the below command
gem uninstall mysql2
gem install mysql2 -v '0.3.21' -- --srcdir=/usr/local/Cellar/mysql/8.0.28_1/bin/include --with-mysql-include=/usr/local/...
0
votes
1
answer
3k
views
bundle update --conservative devise does not update only "devise" gem
I recently tried to update devise to the latest version specified in the gemfile without affecting its dependencies.
gemfile.lock:
devise (3.5.3)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
...
1
vote
1
answer
566
views
minitest/capybara error - NameError: undefined local variable or method 'page'
I'm in the process of updating the hosting for a Rails 3.2 LTS project, taking them from ruby 2.3.3 to 2.7.2.
As part of this I've updated a few gems, specifically updating
minitest from 5.11.3 to 5....
1
vote
1
answer
238
views
Pundit gem error class overriding my custom error class in ruby
my application has custom error classes defined lib/error/*
example
#lib/error/custom_error.rb
module Error
class CustomError < StandardError
attr_accessor :error, :status, :message
...
0
votes
0
answers
29
views
Rails 4 AR .select includes pk field in result even if result is grouped (as opposed to Rails 3.2)
I'm migrating my app from Rails 3.2 to 4.0, and I'm finding a number of broken tests because Rails 4 includes the PK field (usually 'id') in the result set when using something like:
Invoice.where(...
0
votes
0
answers
136
views
uninitialize constant user (work with dto)
I'm learning rails using Devise for authentication purpose and make a User by Rails generate Devise user it creates a user model for me & every thing is works fine But when i put my file (user.rb)...
0
votes
0
answers
62
views
Problem deleting server side cookies in Controller
For an application, I need to remove two server-side generated cookies if the User has selected to not allow cookies. I can detect the cookies, get the consent settings, and everything just fine. ...
1
vote
1
answer
229
views
heroku push of Rails 3.2 app suddenly fails with "Could not detect rake tasks" (no other errors)
I changed nothing in the configuration (no new gems or version changes); just one line of code, but I am now unable to push to heroku. Something must have changed at heroku?
It is Rails 3.2.22.5; ...
0
votes
0
answers
234
views
RAILS 3.2.2.1 > rails assets:precompile LoadError: cannot load such file -- net/ssh/config
rails version 3.2
ruby version 2.0.0 -p451
I'm executing:
rails assets:precompile --trace
Getting the below error.
rake aborted!
LoadError: cannot load such file -- net/ssh/config
/home/hardik/...
0
votes
2
answers
299
views
Rails find_by new column
I am new to rails ,
I have added a new column “control_id” in a table users and same is added in model file under
attr_accessible :control_id
But when I use find_by_control_id(1) . I am getting ...
0
votes
0
answers
74
views
Stack level too deep on upgrading rails 3.1.10 to 3.2.0
I am getting the following errors after upgrading my rails application from 3.1.10 to 3.2.0.
rails console is opening fine. And, I am able to execute code in console. However, When I run rails server ...