ruby-on-rails-3.1 Questions
2
Solved
Is there some way to add the defer attribute easily using the javascript_include_tag helper in Rails?
I.e., is there some easy way to turn
<%= javascript_include_tag "blah.js" %>
into
&l...
Morpheme asked 11/6, 2012 at 14:43
4
Solved
Example I have:
@test = Pakke.find([[4], [5]])
In my Pakke table I have a column named prismd
How do I sum the two values for the prismd
columns for @test?
Colorfast asked 15/1, 2012 at 23:26
3
Solved
I have a Rails 3.1 app that makes use of the paperclip gem (v 3.4.0). In a nutshell. I have a story model and a post model. A story can have many posts.
#story.rb
class Story < ActiveRecord::...
Dicky asked 7/3, 2013 at 0:55
6
Solved
I am calling the date a record was created at in a basic app running Rails 3.1.
<%= @issue.created_at %>
The above outputs the following timestamp:
2011-09-10 14:44:24 UTC
What is the s...
Ore asked 10/9, 2011 at 15:5
5
Solved
In liquid templates this is achieved like so:
{{ product.metafields.book.author }}
Which returns the value of 'author' for it's key 'book'
I'm using Shopify API and Ruby on Rails and have succ...
Wallasey asked 18/7, 2012 at 9:12
10
Solved
How can I retrieve the CSRF token to pass with a JSON request?
I know that for security reasons Rails is checking the CSRF token on all the request types (including JSON/XML).
I could put in my c...
Musteline asked 20/2, 2012 at 14:40
5
Solved
In my users photo album page they see photos they have uploaded and each photo has a 'make default' link on it.
When the user clicks make default, then the id of the photo is stored in the photo_id...
Dissolution asked 21/1, 2012 at 11:7
5
I would like to encrypt and decrypt one attribute string value of a model by using AES algorithm.
I am wondering in Rails, what is the easiest way to have it? Is there any AES gem library which ca...
Selectman asked 13/12, 2011 at 12:46
10
Solved
The force_ssl function in rails 3.1 is hardcoded to ignore the development environment, but not test. This is giving me redirect errors in my (minitest) tests. Is the solution to set up my test ser...
Sidnee asked 24/1, 2012 at 15:25
3
Solved
I am trying to add two different attachment fields. The migration is failing wether i run it using bundler or without. (bundle exec rake db:migrate or just rake db:migrate).
== AddDiagramToQuestio...
Frontispiece asked 22/1, 2012 at 20:53
5
Solved
I am trying to get a basic form to work and am struggling because I keep getting the error
undefined method `profiles_index_path' for #<#<Class:0x4fe1ba8>:0x4fccda0>
I have checked ...
Caernarvonshire asked 7/5, 2012 at 18:10
6
Solved
I'm using Ruby on Rails 3.1 and I'm wondering how I could render a partial in a javascript asset.
What I'm aiming at:
# in /app/assets/javascript/cart.js.coffee.erb
$('a.add_sth').click -> $('...
Halftrack asked 7/9, 2011 at 15:1
6
Solved
Looks like this method doesn't work anymore in rails 3.1. So, does someone have a working solution?
Actually, I've found this gist. It solves problems with columns_hash and column_defaults errors ...
Tevis asked 1/9, 2011 at 19:31
2
Solved
I have been playing around with using rest-client to access a rails app I have written. I've written a quick script to log in and make a post request. Everything is working but I did have to work r...
Cyanocobalamin asked 2/5, 2012 at 12:31
5
Solved
I'm starting a new project in Rails, and it looks like the application.js manifest file is doing something funny with the javascripts that I reference - does it cache those files as part of the ass...
Axiom asked 4/4, 2012 at 2:58
5
Solved
I have two classes: Parent and Child with
Child:
belongs_to :parent
and
Parent
has_many :children, :dependent => :destroy
The problem is that I want to check that there is always at lea...
Frankpledge asked 25/1, 2012 at 9:45
14
Solved
I've created a clean and simple Rails 3.1 application called demo1. It contains two controllers - hello and goodbye. I get the following error when I try to load http://localhost:3000/say/hello:
A...
Destructive asked 2/9, 2011 at 10:4
1
I have a couple of MySQL queries that take a really long time and I'd like to display a progress bar while they are running. Is this possible in Rails with maybe jquery? Does ActiveRecord have any ...
Muraida asked 19/12, 2011 at 9:23
5
Solved
I have been using the pretty looking active admin recently and ran in to some issues happening across my application with a performance issue and other things including the taking over of the...
Frowsy asked 28/10, 2011 at 8:57
2
Solved
I'm learning the basics of ruby on rails and I want to make some simple queries but I have a doubt:
I will have these models:
class Client < ActiveRecord::Base
has_one :address
has_many :ord...
Hoch asked 7/11, 2014 at 11:47
2
Solved
# lib/tasks/test.rake
task :hello do
puts 'hello'
end
$ rake app:hello
To run the task I need to prefix it with "app:" and it runs in the context of the dummy app. It is also exposed to the hos...
Triangulate asked 10/5, 2012 at 11:21
2
Solved
I check the headers on my production server as
curl --head -H "Accept-Encoding: gzip" http://foo.heroku.com/assets/mobile.js
and I get back the following headers which suggest RAILS is not sett...
Mommy asked 22/6, 2011 at 12:22
6
I'm using Impressionist to record page impressions. The database write only takes about 50ms, but I'd really prefer to do it after the page has rendered and been sent to the client.
I've looked in...
Luttrell asked 17/11, 2011 at 12:51
2
Solved
I have a bit of code here where users can login via their twitter account. the problem here is, how can i skip email confirmation for user the sign up from external services like twitter. i am usin...
Chatter asked 20/9, 2011 at 18:24
5
Solved
I've got a Rails 3.1 project that I'm working on, but I don't want controller_name.css.sass and controller_name.js.coffee to be generated each time I run rails generate controller controller_name. ...
Stephanistephania asked 9/9, 2011 at 19:2
© 2022 - 2024 — McMap. All rights reserved.