ruby-on-rails-3.1 Questions
4
Solved
Question: when do I need to use self in my models in Rails?
I have a set method in one of my models.
class SomeData < ActiveRecord::Base
def set_active_flag(val)
self.active_flag = val
self...
Corm asked 29/5, 2012 at 19:6
6
Solved
How can I create an after-confirmation redirect in Devise?
Before I added the confirmation module the custom after_sign_up_path worked fine for the first time login/signup but now when I click the...
Gauthier asked 7/6, 2012 at 6:20
3
I have the following code:
begin
site = RedirectFollower.new(url).resolve
rescue => e
puts e.to_s
return false
end
Which throws errors like:
the scheme http does not accept registry part:...
Tullus asked 29/11, 2011 at 21:34
5
I'm working on an existing Rails app and am using a localization file, en.yml, to hold most of the app's text. At the moment, we aren't localizing into any other languages, so there's just the one ...
Wobble asked 28/12, 2011 at 19:56
4
Solved
I am looking for a reporting gem or tool in ruby on rails. its for a e-commerce app, where I need to generate lot of data like sales report, marketing reporting,etc, I want to keep it more generic ...
Fund asked 23/1, 2012 at 9:20
6
Solved
I have a Rails 3.1 app and for some reason when I change CSS, the changes don't show up. I did bundle exec rake assets:precompile and it helped once, but now I am stuck with the old CSS no matter w...
Gandhi asked 9/3, 2012 at 21:35
8
Solved
I don't know why Its not duplicating like the example. When I put the following code to have this form:
<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resou...
Stare asked 16/2, 2012 at 12:17
6
Solved
I'm in the process of adding Devise to an existing Rails app, with a Users table already defined. The devise generator pushed out the following migration:
class AddDeviseToUsers < ActiveRecord:...
Extramarital asked 27/1, 2012 at 2:47
2
Solved
I am having trouble setting up the redirect for my application. Users should go to their profile (users/show) and admins should go to the admin dashboard.. How do i set this up?
Currently getting ...
Defensive asked 8/7, 2012 at 17:48
3
Solved
how to use curl on ruby on rails? Like this one
curl -d 'params1[name]=name&params2[email]' 'http://mydomain.com/file.json'
Tatyanatau asked 4/4, 2013 at 6:53
9
Solved
Every time I push my app to heroku I see the line
-----> Launching... done, v43
Is there a way to make that version number apear within the app so other people can see that number?
Lotion asked 9/1, 2012 at 17:41
5
Solved
At the moment when I generate a new controller, Rails also generates a .js.coffee file for the controller as well. As I don't use CoffeeScript I want Rails instead generate .js files for me.
Is it...
Aidoneus asked 4/1, 2012 at 4:54
6
I am new to Ruby on Rails
I am getting this error
uninitialized constant WelcomeController
after creating the sample project. I enabled
root :to => 'welcome#index'
in routes.rb.
Carine asked 24/9, 2011 at 6:25
2
Solved
At the first migration, I declared on a column content to be string
Activerecord made it to be string(255) according to annotate gem.
After I push the app to heroku, which uses postgres, if I ente...
Jerrine asked 1/1, 2012 at 16:56
6
Solved
I'm working on a mountable engine for use with Rails 3.1, and I want to list the engine's routes.
I created the engine using:
$ rails plugin new rails_blog_engine --mountable
And edited the 'te...
Drogheda asked 15/9, 2011 at 13:31
4
Solved
I was compiling my asset pipeline for my production environment and it did for all my environments. How can I uncompile my asset pipeline for my development environment?
I have checked my config/d...
Misdoubt asked 19/12, 2011 at 3:29
2
Solved
Let's say my model has an image with :thumb and the client wants :tiny and :nano thumbnails.
How do I reprocess all the existing images using a rake task?
I've found a rake task that I thought wo...
Ringler asked 30/1, 2012 at 14:51
2
Solved
I have a relatively small piece of initializer code that I want to run whenever rails server runs, but not when I run rails generate, rails console or any other rails command (including rake tasks ...
Dedal asked 28/12, 2011 at 18:54
2
Solved
I am new to ruby on rails and have just installed active admin and was trying to customize the
views.
I have a product and image table. Each image belongs to one product.
Now I want to display ...
Stall asked 19/5, 2013 at 23:4
2
Solved
I get a CSV:MalFormedCSVError when I try to import a file using the following code:
def import_csv(filename, model)
CSV.foreach(filename, :headers => true) do |row|
item = {}
row.to_hash.ea...
Chanticleer asked 14/11, 2011 at 17:41
5
Solved
I have a model named Topic, that has a name as a field.
So say I have a term I'm searching for, apple.
If I do a
Topic.find_by_name("apple")
I get a record back with the name apple. That's go...
Slosh asked 14/3, 2012 at 19:1
2
I have trouble using any form of the asset pipeline within mailer, wether the Mailer itself or the view.
The following produces and empty src image tag.
<%= image_tag "emails/header-general.pn...
Antevert asked 27/9, 2011 at 16:29
4
Solved
How can i override current_user of devise gem.
Actually I need to add web services for mobile-app.
Currently devise is managing session and 'current_user' for web-application.
Now Mobile app wi...
Resplendent asked 27/4, 2012 at 11:14
3
Solved
I have an object that has_many child objects that should be rendered as xml. This is not a problem. My Problem is that I creat a Hash containing this data like the parser needs it. But rails atomat...
Crouch asked 11/1, 2012 at 12:43
4
Solved
Whenever I have an application using ActiveRecord I get this ConnectionTimeoutError - but always after a certain unknown period of time
ActiveRecord::ConnectionTimeoutError (could not obtain a dat...
Coulometer asked 20/8, 2012 at 21:31
© 2022 - 2024 — McMap. All rights reserved.