Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Denis Savitsky's Profile

GitHub User: sadfuzzy

Comments by Denis Savitsky

Avatar

Great episode, thanks!
There is one more thing on jQuery i'd like to know about: why sometimes in development mode remote scripts executes twice (like double text_form submits) when 'requre tree .' is enabled?

Avatar

Adding the ruby//= require private_pub to application.js is missed in the manual

Avatar

In #360 Ryan used this:

ruby
class SessionsController < ApplicationController
  def create
    user = User.from_omniauth(env["omniauth.auth"])
    session[:user_id] = user.id
    redirect_to root_url
  end

  def destroy
    session[:user_id] = nil
    redirect_to root_url
  end
end

class User < ActiveRecord::Base
  def self.from_omniauth(auth)
    where(auth.slice(:provider, :uid)).first_or_initialize.tap do |user|
      user.provider = auth.provider
      user.uid = auth.uid
      user.name = auth.info.name
      user.oauth_token = auth.credentials.token
      user.oauth_expires_at = Time.at(auth.credentials.expires_at)
      user.save!
    end
  end
end
Avatar
ruby
u.facebook.put_connection("me", "cinematron:review", movie: "http://samples.ogp.me/457069940972565")

should be

ruby
u.facebook.put_connections("me", "cinematron:review", movie: "http://samples.ogp.me/457069940972565")
Avatar

Should also have "set :normalize_asset_timestamps, false" in deploy.rb

Avatar

Sure, everyone, who has

FATAL:  could not create shared memory segment: Cannot allocate memory
DETAIL:  Failed system call was shmget(key=1, size=1646592, 03600).

problem, can easily fix this.
Run:

sh
sudo sysctl -w kern.sysv.shmall=65536
sudo sysctl -w kern.sysv.shmmax=16777216

(The first one's the critical one, but second seems appropriate too.)
This changes the limits in the currently-running kernel. To make these values stick across reboots, add them to /etc/sysctl.conf, like this:

kern.sysv.shmall=65536
kern.sysv.shmmax=16777216

Found this here

Avatar

Well, you showed the Rails Sexuality :)

Avatar

Thanks! But video quality is not usual :(

Avatar

'ilike' dosn't work for mysql.
MySql has an alternative: 'select * from foo where upper(bar) like upper(?)'.

preventDuplicates is really useful, thanks

Avatar

Ryan, thanks very much! I use Railscasts every day, finding answers to any questions. it is programmers' desk book indeed!

Avatar

I'm stack with this too. Any success?

Avatar

You have mistyped:

bash
curl http://localhost:9292/faye -d 'message={[channel]("/messages/new",) [data]("hello"}')

Must be:

bash
curl http://localhost:9292/faye -d 'message={[channel]("/messages/new"), [data]("hello")}'
Avatar

it's k now, but the broadcasting doesn't work - it doesn't reload messages inside chat window, when anoyher client adds something

Avatar

why the respond from faye can not be understood by browser(the chat window and text field are not reloaded)?

Avatar

Can you make a new one, applying to the rails 3, please?