ruby-on-rails-3.1 Questions
6
I'm just trying to get the most basic of basic shell of a rails app running under 3.1, and I'm getting this weird error when I run bundle exec rake db:migrate-
Please install the mysql2 adapter: `...
Simulacrum asked 26/7, 2011 at 6:15
3
not having a lot of luck lately with answers in Stackoverflow (I think I'm the king of the tumbleweed award) but here goes anyway:
How can I update only fields that are empty when using activeReco...
Purpurin asked 8/2, 2012 at 10:34
3
Solved
I am new to rails 3, I would like to add (:target => "_blank") to link_to helper below
link_to "GOOGLE", 'http://www.google.com', class: "btn btn-large btn-primary"
But I would like to use the ...
Parrisch asked 8/8, 2012 at 22:46
7
I've tried using the Sanitize gem to clean a string which contains the HTML of a website.
It only removed the <script> tags, not the JavaScript inside the script tags.
What can I use to rem...
Duplicate asked 28/11, 2011 at 5:18
4
Solved
I'm wondering is there a way we can chain a method using (&:method)
For example:
array.reject { |x| x.strip.empty? }
To turn it into:
array.reject(&:strip.empty?)
I prefer the shorth...
Immunogenetics asked 27/2, 2012 at 4:50
10
Solved
My website has been broken since Dreamhost upgraded their servers a couple of weeks ago. I have been tearing my hair out trying to get it fixed and made some progress but am stuck on what is hopefu...
Holography asked 9/11, 2011 at 1:25
4
Solved
I'm newvbie in ruby on rails.. I'm having problem with gsub.. I everytime I go to the list of my store page it says "undefined method `gsub' for nil:NilClass"..
here is mycode :
def self.searc...
Phenoxide asked 16/7, 2012 at 5:24
6
Solved
I am trying to use the .tooltip() that I found from the following: Jquery-ui tooltip. What I have is a rails app that has some information in a table. In separate cells. Currently you can view the ...
Salema asked 22/2, 2012 at 12:4
12
Solved
I'm using RSpec/Capybara as my test suite. I have some javascript that dynamically appends <li> to the end of a <ul>. I want to write a request spec to ensure that this is happening.
...
Houser asked 7/12, 2011 at 22:32
7
Solved
Can someone tell me if I'm just going about the setup the wrong way?
I have the following models that have has_many.through associations:
class Listing < ActiveRecord::Base
attr_accessible .....
Hatband asked 5/8, 2011 at 22:30
4
Solved
I am maintaining someone's code base and they have something like this:
if @widget_part.destroy
flash[:message] = "Error deleting widget part"
else
flash[:message] = "Widget part destroyed succe...
Keister asked 28/9, 2012 at 20:2
4
Solved
We are using the following to check if stock_qty (an integer or a float. Could be zero but not nil) is greater or equal to zero:
validates_numericality_of :stock_qty, :greater_than_or_equal_to =&g...
Braw asked 17/4, 2012 at 20:6
2
Solved
I have read few posts regarding NaN but did not figure out how to deal with it in Ruby on Rails. I want to check a value if it is a NaN I want to replace it with Zero(0).
I tried the following
lo...
Principal asked 3/10, 2013 at 8:34
3
Solved
When running:
rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
Everything precompiles but not my /app/assets/images/*
I even tried adding this to my environment/production.r...
Occultism asked 8/11, 2011 at 15:30
9
Solved
Is there a way to run rake commands for db:migrate and db:rollback on the console?
It sucks to wait for the rails environment to load!
Edith asked 2/9, 2011 at 17:39
3
Whereas the verbose feature of SQL/ActiveRecord calls is useful most of the time, I would like to turn it off in cases where I have some looping going on.
Is there a way to turn it off?
irb(main)...
Dowitcher asked 1/11, 2011 at 13:11
2
Solved
I'm having a rough go integrating ryanb's awesome nested_form gem into my rails 3.1.3 application. I'm afraid my Javascript skills are too limited to know whether it's my code (likely) or the gem t...
Dacoity asked 19/4, 2012 at 14:38
7
Solved
I just installed Passenger 3.0.11 and nginx and got this error:
Starting nginx: /opt/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such...
Dinner asked 14/12, 2011 at 8:6
14
Solved
I have two Ruby on Rails DateTime objects. How to find the number of months between them? (Keeping in mind they might belong to different years)
Rutaceous asked 24/2, 2012 at 9:48
3
Solved
I am having trouble with serving up my rails app on a remote computer after upgrading from Rails 3.0 to 3.1. So I want to take a look at what exactly is going wrong when Apache attempts to start up...
Swafford asked 27/12, 2012 at 19:48
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
3
Solved
I cloned one of my own apps using Rails 3.1.3, created an app on Heroku on stack cedar, pushed the to Heroku, and then tried to run
heroku run rake db:migrate and got this error message
No Rakef...
Electrodeposit asked 31/3, 2012 at 19:5
6
A cookie associated with a cross-site resource at https://example.com/ was set without the SameSite attribute. It has been blocked, as Chrome now only delivers cookies with cross-site requests if t...
Horbal asked 5/12, 2019 at 12:32
10
Solved
I am confused about the main difference(s) among link_to, redirect_to and render in Rails. anyone can please explain.
Flotage asked 21/6, 2013 at 13:11
4
Solved
Pluralizing a single word is simple:
pluralize(@total_users, "user")
But what if I want to print "There is/are N user/users":
There are 0 users
There is 1 user
There are 2 users
, i.e., h...
Uneasy asked 9/1, 2012 at 14:40
© 2022 - 2024 — McMap. All rights reserved.