I'm trying to update a user without having to provide a password, but approaches that worked on older devise/rails versions no longer work with devise 3 and rails 4 strong parameters. I'm using my user_controller to update but I have also tried using a custom devise registration controller with devise_parameter_sanitizer, without success. The form does not require a password (has no password field
I am creating a chat using Ajax requests and I'm trying to get messages div to scroll to the bottom without much luck. I am wrapping everything in this div: #scroll { height:400px; overflow:scroll; } Is there a way to keep it scrolled to the bottom by default using JS? Is there a way to keep it scrolled to the bottom after an ajax request?
I used Ruby on Rails on Red Hat server. When I trying to generate a controller file, I got this error: [ec2-user@ip-172-31-22-128 testApp4]$ rails generate controller welcome /home/ec2-user/.rvm/gems/ruby-2.1.2/gems/spring-1.1.3/lib/spring/server.rb:22:in `initialize': Permission denied @ rb_sysopen - /tmp/spring/fea371aaf9d69cfa58bd12f69b3f1bf6.pid (Errno::EACCES) from /home/ec2-user/.rvm/gems/ru
After googling, browsing SO and reading, there doesn't seem to be a Rails-style way to efficiently get only those Parent objects which have at least one Child object (through a has_many :children relation). In plain SQL: SELECT * FROM parents WHERE EXISTS ( SELECT 1 FROM children WHERE parent_id = parents.id) The closest I've come is Parent.all.reject { |parent| parent.children.empty? } (based on
Using the rails 3 style how would I write the opposite of: Foo.includes(:bar).where(:bars=>{:id=>nil}) I want to find where id is NOT nil. I tried: Foo.includes(:bar).where(:bars=>{:id=>!nil}).to_sql But that returns: => "SELECT \"foos\".* FROM \"foos\" WHERE (\"bars\".\"id\" = 1)" That's definitely not what I need, and almost seems like a bug in ARel.
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く