ruby-on-rails-3.1 Questions
11
Solved
When I add the 'Required' attribute
to html input fields, Rails pre-pends an asterisk (*) before the label.
Does anyone know how to prevent this?
For some reason Rails transforms this:
<%= f...
Val asked 4/10, 2011 at 15:56
3
Solved
I have a Rails engine, MyEngine, that doesn't have an isolated namespace. I'm trying to use the polymorphic helpers to generate links to resources, as per the docs.
An engine route:
# config/rout...
Hirschfeld asked 29/8, 2012 at 6:23
3
Solved
I have an existing rails backend website which makes json calls to server. Now,I am developing a mobile iOS app to use the same backend and send calls in json. However, mobile requests are failing ...
Rachellerachis asked 20/5, 2012 at 18:28
5
With SQL I can easily do sub-queries like this
User.where(:id => Account.where(..).select(:user_id))
This produces:
SELECT * FROM users WHERE id IN (SELECT user_id FROM accounts WHERE ..)
...
Swoon asked 30/3, 2011 at 7:47
2
Solved
I have a simple model
class User
has_many :logs
class Logs
related in the usual way through the foreign key logs.user_id. I'm trying to do the following using Arel and according to the Arel d...
Sackett asked 23/9, 2011 at 12:12
5
Solved
I have a model with a method to return a url to a person's avatar that looks like this:
def avatar_url
if self.avatar?
self.avatar.url # This uses paperclip
else
"/images/avatars/none.png"
e...
Tivoli asked 1/9, 2011 at 8:16
4
Solved
I'm trying to get my virtual attribute that is a boolean to work. In this example, lets call the virtual boolean field children:
models/parent.rb
Parent
attr_accessible :children
attr_accessor ...
Polynices asked 7/8, 2012 at 23:22
4
Solved
These are the instructions to add a module to an existing Devise install: https://github.com/plataformatec/devise/wiki/How-To:-change-an-already-existing-table-to-add-devise-required-columns
But I...
Kowalski asked 22/9, 2011 at 19:18
4
Solved
How can I retrieve the current Git commit version from within a Ruby on Rails app?
Want to display the Git version (or maybe the last 6 letters or so) to serve as an App version.
Reactivate asked 6/12, 2011 at 21:30
3
Solved
How can I parse urls like
http://www.1800contacts.com/productlist.aspx?dl=P&source=cj&ac=8.2.0007
and only get
http://www.1800contacts.com
?
PS. Some urls have subdomains etc so I can'...
Guideline asked 27/11, 2011 at 18:56
7
Solved
In routes i have the root-path pointing "home#index" but when i try to override that with after_sign_up_path_for keeps redirecting me to the root path when I sign in or sign up. I have tried to put...
Acton asked 3/11, 2011 at 23:44
3
Solved
Couden't find any compare questions related to sunspot (Solr) to Elastic Search (Lucene)
What would be the pro's and con's on both search engines?
I saw other VS questions to get a better inside ...
Oversew asked 6/2, 2012 at 12:44
4
Solved
using this tutorial
http://railscasts.com/episodes/57-create-model-through-text-field
need to make it work in my app, was on rails 3.0.7 and it worked fine, updated it to 3.1.3 and I got this err...
Karttikeya asked 14/5, 2012 at 18:11
29
Solved
To my understanding, all of your JavaScript gets merged into 1 file. Rails does this by default when it adds //= require_tree . to the bottom of your application.js manifest file.
This sounds lik...
Nobe asked 29/5, 2011 at 12:46
6
I'm trying to override some the functionality of the default devise registrations controller so that only certain users can create accounts for others. So in a file called registrations_controller....
Sewoll asked 11/12, 2011 at 19:33
3
I'm updating my rails 2 apps to rails 3 and find that the use of 'render :text' does not behave the same anymore.
@results is an array. In my controller:
render :text => "<ul>#{@results}...
Oxa asked 30/3, 2012 at 0:51
2
Solved
I am trying to detect my db at heroku terminal like this:
myapp@ubuntu:~/RubymineProjects/myapp$ heroku pg:info
The plugin heroku-sql-console has been deprecated. Would you like to remove it? (y/N...
Sherry asked 5/2, 2013 at 20:29
4
Solved
Good evening. I have a problem. i am using has_secure_password
and cause of this i have an error undefined methodpassword_digest=' for #`,
but i dont have this method!! Please help, dont know what...
Hostel asked 13/10, 2011 at 18:54
7
Solved
Is there an easy way (i.e. a configuration) to force ActiveRecord to save empty strings as NULL in the DB (if the column allows)?
The reason for this is that if you have a NULLable string column ...
Coz asked 26/8, 2011 at 8:59
2
Solved
One of my favourite debugging features of SCSS is the @warn and @debug directives, which both aid with debugging. However, when I place either of these in my scss files in a Rails 3.1 project, they...
Kight asked 2/12, 2011 at 16:8
3
Solved
My tag:
<%= select_tag(:option, options_for_select([['All', 1], ['Co', 2], ['Bought', 3], ['View', 4], ['Top API', 5], :selected => :option ])) %>
How do I set the selected value to wh...
Plotkin asked 6/3, 2013 at 16:33
5
I currently have migration called Products, and I simply want to add few more strings to this migration such as description and product type. What is the best way to do this?
class CreateProducts...
Repetend asked 1/3, 2013 at 16:14
3
I created a new engine in Rails 3.1.3 and apparently there's that rake task that copies over all migrations. I tried following rake abc:install:migrations which threw:
rake aborted!
Don't know how...
Beast asked 5/1, 2012 at 15:35
3
Solved
My Rails app passes its test but then says 0% passed. Its a Rails 3 app converted to 3.1.
5 tests, 11 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
0% passed
If I ge...
Melbourne asked 9/10, 2011 at 20:54
3
How can I generate the first page of a pdf as a thumbnail in paperclip?
I tried a lot but it's not working
has_attached_file :book_url, :styles => {
:thumb => "100x100#",
:small => "1...
Allerus asked 4/1, 2014 at 11:12
© 2022 - 2024 — McMap. All rights reserved.