Displaying 20 results from an estimated 40000 matches similar to: "nested forms in activeadmin is mass assigning"
2012 Jan 29
0
ActiveAdmin: Nested attributes not working for STI
HI All,
I am having Model "Customer" using STI for sender and receiver, and i am
unable to save the both sender and receiver by nested attribute. Below are
my model and active admin resource codes, correct me if i am wrong nested
attribute on concept.
CUSTOMER MODEL:
class Customer < ActiveRecord::Base
belongs_to :sender, :class_name => "Customer"
has_many
2012 Sep 16
1
“Routing Error No route matches {}” when omniauth failed on registration
(Original question was asked here:
http://stackoverflow.com/questions/11506734/routing-error-no-route-matches-when-omniauth-failed-on-registration
)
I am using omniauth-identity and configure its "fail on registration".
My files:
config/initializers/omniauth.rb
OmniAuth.config.logger = Rails.logger
Rails.application.config.middleware.use OmniAuth::Builder do
#...
provider
2013 Mar 26
0
nested forms: use validate :some_method works in update mode only
I have a strange behavior when validating a record in a nested form. The
association collection is empty when creating a new record and the
validation does not catch the error. But when updating the same record the
validation gets it right but continues to catch the error even after
modifying the needed attribute value to make it pass.
Here is the model:
#timesheet.rb
class Timesheet <
2012 Oct 18
0
unexpected return (LocalJumpError) only when executing this code within autoloaded classes?
Posted on stackoverflow but no traction yet:
http://stackoverflow.com/questions/12942505/why-does-using-set-trace-func-work-in-some-places-but-cause-unexpected-return-l
The following is a generified part of the code in a gem I''m working on:
module SomeModule
class << self
attr_accessor :procedure
def log_events(*args)
args.flatten!
2011 Oct 05
2
formtastic / activeadmin
Newbie question:
want to following code to migrate to formtastic:
<% f.fields_for :assets do |asset_fields| %>
<% if asset_fields.object.new_record? %>
<p>
<%= asset_fields.file_field :asset %>
</p>
<% end %>
<% end %>
tried this:
f.inputs "Appartment Details" do
f.input :assets do |asset_fields|
2012 Mar 30
1
cancan breaks scoped mass assignment
Hi all,
I just installed cancan on a new project and found out that it creates
some problems with the new scoped mass assignment features of rails 3.2
.
Basically, in my User model I create some attr_accessible attributes in
order to avoid users to edit their roles or other sensitive information.
From the administration I allow admins to edit those protected
attributes by passing
2012 Jan 26
2
Problem while creating new resource on ActiveAdmin
HI All,
I have installed the Active Admin successfully, but facing the following
error while restarting the server after generating an resource.
*rails generate active_admin:resource item*
/home/logs/Desktop/training/RAILS/courier/app/admin/items.rb:1:in `<top
(required)>'': uninitialized constant Item (NameError)
from
2013 Feb 10
1
How to add body parameter in Serel gem (stackoverflow api)
Actually when i try to access a question using serel gem(which is a ruby
wrapper for stackoverflow api), i get an object with no body parameter
included in it.
questions = Serel::Question.find(id)
see http://api.stackoverflow.com/1.1/usage/methods/questions-by-ids.
According to this, we need to turn the body parameter true.
How to turn the parameter "body" true.
--
You received
2012 Jun 29
0
Can I make Rails update_attributes with nested form find existing records and add to collections instead of creating new ones?
Hi there,
I''ve asked this question at stackoverflow.com
http://stackoverflow.com/questions/11257662/can-i-make-rails-update-attributes-with-nested-form-find-existing-records-and-ad
I haven''t seen a better answer than one I propose myself but I''d like to
know if it''s possible to enhance accepts_nested_attribute_for to allow a
find_or_create_by behavior for
2013 Feb 28
1
Make `ActionView::Helpers::InstanceTag#tag_id`, `ActionView::Helpers::InstanceTag#tag_id_with_index(index)` public?
As I asked in StackOverflow<http://stackoverflow.com/questions/15127658/hoe-to-get-tag-id-from-a-record-in-form-for/15129741>
I think it would be helpful since we can dynamically create javascript code
to control each input tag in form helper, what do you think? Or there has
already been a solution?
--
You received this message because you are subscribed to the Google Groups "Ruby
2013 Feb 10
2
What's wrong with my spec? (StackOverflow Question)
Hi all, I just posted a question on SO and it would be great if you guys
could help out.
http://stackoverflow.com/questions/14795829/devise-rspec-user-requires-account-activation-in-requests-spec-even-after-con
Cheers!
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails
2006 Jun 24
0
Mass assignment to an AR that would call assignment methods.
Hi
I have an AR instance foo that recently got an assignment method
#bar=. Before this addition I could use mass-assignment for foo with:
Foo.new(params[:foo])
and:
foo.attributes = params[:foo]
But appearantly assignment methods like #bar= don''t get called with
the 2 examples above. I have to:
foo = Foo.new
params[:foo].each do |key, val|
rec[key] = val
end
and something very
2013 Sep 04
2
Speed up image processing of Paperclip in Acceptance Tests
Hi All,
I have a question here: How to Speed up image processing of Paperclip in
Acceptance Tests
When running capybara feature specs I can see lots of Slow factory notices
which are populated byfactory_girl. These Slow factory things heavy slow
down the feature specs, I think, even feature specs are intrinsic slow
specs. Then I had some inspect and found out most of the Slow factory was
2013 Mar 25
1
validates presence of foreign key fails in nested form
I''m using accepts_nested_attributes as follows:
class Timesheet < ActiveRecord::Base
attr_accessible :status, :user_id, :start_date, :end_date,
:activities_attributes
has_many :activities, dependent: :destroy
has_many :time_entries, through: :activities
accepts_nested_attributes_for :activities, allow_destroy: true
end
class Activity < ActiveRecord::Base
attr_accessible
2010 Jan 21
2
nested forms and attr_accessable
Rails 2.3.5
I am working on a nested form that assigns roles to users through a
table called clearances. I have attr_acessable turned off globally in
an initializer:
ActiveRecord::Base.send(:attr_accessible, nil)
I have this set in clearance.rb
attr_accessible(:description,
:effective_from,
:role_id,
:superceded_after,
:user_id)
And this is what params looks like after the
2009 Nov 22
2
WARNING: Can't mass-assign these protected attributes: active
Hi,
I''m trying to understand this error:
WARNING: Can''t mass-assign these protected attributes: active
I had this error before when creating a record.I did not mark the attibutes
posted from the form as attr_accessible, so when the following line tries to
execute it throwed an Warning in the log, and the record was not saved.
@user = User.new(params[:user])
I find out that I
2006 Apr 27
1
validates_acceptance_of, virtual attributes and mass assign
Hi,
I''ve a question concerning validates_acceptance_of method.
Documentation says that the validated attribute is a virtual one,
without a field in db. But when I add such an attribute to my form (say
check_box(:xyz, :agreement)), it''s passed in params[:xyz][:agreement],
but not assigned when calling Xyz.new(params[:xyz]), probably because
corresponding field
2012 Nov 05
3
DragonFly Object not found in Production
could please anyone help me with this issue?
http://stackoverflow.com/questions/13237954/object-not-found-in-production
thanks,
enrico
--
· Enrico Stano
·
· twitter @enricostano
· skype ocirneonats
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2012 Apr 27
1
Can't mass-assign protected attributes even if I use attr_accessible
Hi,
I''m working on a Rails 3.2.2 application which has JSON APIs and I use a
CLI client for inserting some data. It works fine except for the Author
model. When I try to create a new post (Post belongs_to :author and
Author has_many :posts) I get the following error :
<h1>
ActiveModel::MassAssignmentSecurity::Error in
PostsController#create
</h1>
2012 Oct 05
2
heroku rake db:drop error PG::Error: FATAL: permission denied for database "postgres"
How to empty DB in heroku<http://stackoverflow.com/questions/4820549/how-to-empty-db-in-heroku>
I have a Postgres database on Heroku. It is one of the free beta ones.
Locally, when testing, I often run rake db:drop && rake db:create && rake
db:migrate as a way to reset the database.
However, when I try to run this on Heroku, I get the error:\[code\]Couldn''t
drop