Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

weblee's Profile

GitHub User: weblee

Comments by weblee

Avatar

I have never seen it done this way before so threw me as well. But one thing still gets me why in the other class methods you are not using the attribute @user ie,

ruby
  def send_email
    generate_token
    @user.password_reset_sent_at = Time.zone.now
    @user.save!
    UserMailer.password_reset(@user).deliver
  end

  def expired?
    @user.password_reset_sent_at < 2.hours.ago
  end

Is it because of the attr_reader?

Avatar

Nice one Ryan,

Would be good to expand this tutorial on how to secure your API with tokens or usernames and passwords? Also the possibility of using CanCan to authorize the api methods.

I would have it a guess the best place to start would be to create a api base class where most of that work could be done?

Avatar

Thanks Scott, Going to give rubber a go I recon.

Avatar

Ill add another new question re rubber.

If you start of with a small app so only one server required for all roles how well does rubber handle breaking this up once hopefully you start to get bigger. ie creating separate roes for App, Web & DB.

Would you have to convert your existing role to be just DB??

Also what about auto scaling. Is there a way to have rubber auto scale app and db slave servers if required?

And one more to chuck in what about setting up staging environment?

But like Alexander has said this seems a great tool.

Avatar

If you are using POW then you can setup a file called .powenv in the root of your app ie.

ruby
export GMAIL_USERNAME ='someone@gmail.com'

You can then use in your app like normal ie.

ruby
user_name = ENV['GMAIL_USERNAME']

DOCS: http://pow.cx/manual.html#section_2.2

Avatar

We have tested yes! A resent client with heavy SEO development was ranking around bottom of page one for a number of years. With just the movement to UK server we have seen a 4 place growth with no extra SEO work done. Its a clear indication that it has an effect.

SEOMOZ still stands true with this as well if you search out there forums. But I do think It has come the day for it not to with cloud being so big now.

Avatar

It has everything. see link

Although this is a little old it still stands true.

Avatar

I would love to use Heroku but there servers are US based and for SEO purposes my clients are all UK and UK based services.

Would be nice if Heroku could supply UK based service.

Avatar

If Linode is your thing another quick way to setup a VPS is to use a StackScript.

http://www.linode.com/stackscripts/view/?StackScriptID=1291

Includes:
*Rails 3
*Ruby 1.9.2
*Nginx with Passenger
*MySQL
*git
*Updates rubygems
*Install rails 3
*Install mysql gem
*Add deploy user

Nice work again Ryan but would love a full cast on deployment.

Avatar

I agree. Multi Steps Forms re-factored would be nice. BUMP :-)

Avatar

Another small update from version 1.0 of omniauth you will need to change the key user_info TO info in the user model ie.

ruby
self.email = omniauth['info']['email'] if email.blank?
Avatar

HAHA I was like Matthew until I came back here and read this thread TY Geoff.

On another small note I have different backend/frontend folders for my style sheets so I had to do.

ruby
*= depend_on "backend/projects"
Avatar

Watching how you converted your JS to CS just makes sense. Before I was thinking I could not be bothered but now I think I maybe become a convert.

Thanks Ryan great cast.