I've got two models
class SurveyResponse
has_many :answers, :class_name => SurveyResponseAnswer.name
accepts_nested_attributes_for :answers
end
class SurveyResponseAnswer
belongs_to :survey_response
validates_presence_of :answer_text
end
In my nested form if validation fails I get this error displayed on the screen:
"answers...
I'm using Rails 3 w/ Mongoid, (so no ActiveRecord). Mongoid uses ActiveModel's "to_json" method, and by default that method includes the root object in the JSON (which I don't want).
I've tried putting this in an initializer:
ActiveModel::Base.include_root_in_json = false
But get the error
uninitialized constant ActiveModel::Base
...
Let's say I'm using attachment_fu to attach profile pics to user profiles in a system, with Amazon S3 used as the actual file storage. When users upload new profile pics, I'd like to replace the attached file with the new one. I can do this within my database (i.e. the file metadata) easily, but attachment_fu doesn't seem to provide meth...
Hi all,
Is there any provisions in rails that would allow all AJAX POST requests from the site to pass without an authenticity_token?
I have a Jquery POST ajax call that calls a controller method, but I did not put any authenticity code in it and yet the call succeeds.
My ApplicationController does have 'request_forgery_protection' an...
I want to use the LinkedIn gem But not the one that I get when I type
sudo gem install linkedin
I want a specific one that somehow has done patches to. It is a fork of the original which is:
http://github.com/jbasdf/linkedin
I tried:
sudo gem install jbasdf-linkedin
But not succeed. Any ideas? Thanks.
...
i have a rails app which makes heavy use of activeresource and httparty to make api calls.
Is there any library/extension to log the requests and parse them, so that log analysis becomes easier and automated.
RailsLogAnalyser is good but what about extra calls, what are the conventions?
Something like a opensource/self-hosted alte...
Hi everyone,
I am currently working on a project and i would like my users to be able to backup/restore theirs accounts.
I am looking for a rails plugin/gem that would easily do that, ie :
current_user.backup()
=> backup_file
current_user.restore(backup_file)
=> database import/replace
I don't know if my questi...
I have a model "Product" with a "description" field. Now I want to have a link in the index page that when clicked will show all products where the description is blank (empty).
In the model I have defined a named_scope like this
named_scope :no_description, :conditions => { :description => "" }
I have checked that the named_sco...
Short story: I can't get an entity like '𠂉' to store in a MySQL database, either by using a text field in a Ruby on Rails app (with default UTF-8 encoding) or by inputting it directly with a MySQL GUI app.
As far as I can tell, all Chinese characters and radicals can be entered into the database without problem, but not these rarely typ...
User in my web app are able to upload file. I use Paperclip to handle file attachment issue. Is there any method if I would like to remove any specific user-uploaded file programmatically?
...
Is there a way to configure restful_authentication such that you can get admin functionality e.g. suspension and purging accounts WITHOUT having to activate accounts via email?
...
I have a multi-tenant application and I'm experimenting with using the i18n gem to allow each of our clients to customize the system to their liking, changing the text on various pages, customizing emails, and so forth. Admittedly, I'm not using i18n as it was intended to be used, since I'm not actually translating different "languages",...
Hi,
I am using facebox popup in one of my pages. I am having a button in the popup dialog. When I click that button the facebox popup should close (the same way it closes when we press outside the popup). How to do that?
Also, I am doing some Ajax stuff when that button is being pressed so I cannot override the onClick event.
...
Hi,
I am trying to import contact list in my Ruby On Rails application.
I got succeed using sailthru API, but the problem is, it replies empty result for aol, msn, hotmail.
I also tried rails gem 'contacts', that is also not replying for all(only answers for gmail, yahoo, aol). :(
Thanks to reply in advance,
Alpesh Modi
...
I am a windows developer currently getting into Rails. While you can develop on RoR Windows, it's not the ideal experience. Things are glitchy and running cucumber tests are painfully slow.
So, would I be able to have a decent dev experience running Linux in a VM for doing RoR development, or should I bite the bullet and just do a dual ...
I am still using the old colon syntax (I prefer it more than the
bracket syntax) and this particular code:
a.button-link
+box($main-color)
+border-radius(5px)
:background
:color $main-color
:color #fff
:padding 5px
generates a warning like so:
DEPRECATION WARNING:
On line 12, character 3 of '/Users/eumir/rail...
My application accepts file uploads, with some metadata being stored in the DB, and the file itself on the file system. I am trying to make the metadata visible in the application before the file upload and post-processing are finished, but because saves are transactional, I have had no success. I have tried the callbacks and calling c...
I have the following routes in my app:
GET /admin/comments(.:format) {:controller=>"admin/comments", :action=>"index"}
admin_comments POST /admin/comments(.:format) {:controller=>"admin/comments", :action=>"create"}
new_admin_comment GET /admin/comments/new(.:fo...
When i set map.root :controller => "welcome", I get the standard rails page, rather than the welcome page. I have deleted public/index.html and "localhost:3000/welcome" works.
Any ideas?
...
Hello.
I am running rake task(which must be being launched for ~24 hours) but it stops in unexpected time.
STRERR is empty.
The code which runs the task:
@bucket = Bucket.find(params[:id])
cmd = "#{`which rake`.chomp} bucket:generate[#{@bucket.id}] --trace 2>&1 > #{Rails.root}/log/bucket-#{@network.id}.log &" # 2> #{Rails.root}/log/buck...