RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: victorrodrigues
Site: http://victor.tc
Why you no create a task to run the whenever --write-crontab?
Instead using <%= hidden_field_tag "product[category_ids][]", nil %> i used in my controller update action something like this:
<%= hidden_field_tag "product[category_ids][]", nil %>
params[:product] ||= {} params[:product][:category_ids] ||= []
This works fine too! :)
I got the same problem!
Sorry! It's:
update: -> $.ajax({ type: 'post' data: $(this).sortable('serialize') headers: {'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content')} url: $(this).data("update-url") })
Im using Ruby 1.8.7 and Rails 3.1 and i was getting this error WARNING: Can't verify CSRF token authenticity when released the drag.
WARNING: Can't verify CSRF token authenticity
So i google it and I had to do a modification of Coffee Script:
update: -> $.ajax({ type: 'post' data: $('#banners').sortable('serialize') dataType: 'script' headers: 'X-CSRF-Token': '<%= form_authenticity_token.to_s %>' complete: (request) -> $('#banners').effect('highlight') url: $(this).data("update-url") })
I hope to help someone else who has this problem!
Adolfo,
I had this same problem, but, my mistake. (i'm leaning Rails, lol) On the "if else statements" in Rails 3 need to be:
respond_to do |format| if @user.save if params[:user][:avatar].blank? format.html { redirect_to @user, :notice => 'User was successfully created.' } format.json { render :json => @user, :status => :created, :location => @user } else format.html { render :action => "crop" } end else format.html { render :action => "new" } format.json { render :json => @user.errors, :status => :unprocessable_entity } end end
And not only just render :action => "crop". I do not know if that was your problem, but it was mine...
render :action => "crop"
Why you no create a task to run the whenever --write-crontab?
Instead using
<%= hidden_field_tag "product[category_ids][]", nil %>
i used in my controller update action something like this:This works fine too! :)
I got the same problem!
Sorry! It's:
Im using Ruby 1.8.7 and Rails 3.1 and i was getting this error
WARNING: Can't verify CSRF token authenticity
when released the drag.So i google it and I had to do a modification of Coffee Script:
I hope to help someone else who has this problem!
Adolfo,
I had this same problem, but, my mistake. (i'm leaning Rails, lol)
On the "if else statements" in Rails 3 need to be:
And not only just
render :action => "crop"
.I do not know if that was your problem, but it was mine...