Given the changes with Redcarpet, I was not able to get the steps in this Railscast to work. But, I used it to help me understand what I was looking at in figuring out what to do next. I got Redcarpet working with my Rails 4, RC1 blog. If you'd like steps, you can peek at it here:
If the only reason they're not switching is because they already have an account, then they're probably not that grumbly. We're talking about subtle unconscious cues that influence the stats in otherwise unnoticeable ways here, not torturing users and tying a lease around their neck.
I struggled a bit, while converting my rails-api app to use ActiveModelSerializer, on how to modify my specs to check for the JSON coming back (without doing something ugly like hard coding them).
Thanks to Ryan for this RailsCast - it got me to take a look at active_model_serializer, as shown at the end of the asciicast, and using that in my tests simplified things.
You can see my conversion to active_model_serializer in this commit, including my request spec changes.
He gave the example of what this would look like with Capistrano. What if I just want to run it locally to test it out? Also, how do you deploy it to the server if you are not using Capistrano?
Processing by PagesController#show as
Parameters: {"id"=>"favicon"}
Page Load (0.2ms) SELECT "pages".* FROM "pages" WHERE "pages"."permalink" = 'favicon' LIMIT 1
Can someone tell me why the get ':id', to: 'pages#show', as: :page route in my route.rb file is passing favicon as an id parameter?
Thanks for this Ryan.
I have a problem, every chart that I want to draw will be in "Line charts".
even when I put
chart: {
renderTo: 'container1',
type: 'bar'
},
it will in "Line charts" not in 'bar'.
Is the inaccessible current_user problem still true ?
the Purpose section of AMS readme says
"Serializers know about both a model and the current_user" so...
Hi, when I click the reset password button its giving me a validation error saying Validation failed: Password can't be blank?
Any help? I'm quite new to this?
how about the live email account configuration that is similar with gmail smtp configuration?
example
username: myemail@live.com
password: SamplePassword
Great stuff.
What about the sqlite :memory: database ? I have been using this since months for my tests, just to speed up the database transactions without having to change the specs. Not sure how big the gain is in the current rails but it was a big improvement once.
Thanks for the cast Ryan you spelt it well as usual. But somehow I share that kind of disappointment with Cyle. It is not if anything were missing, it is just there is no big Wow as there has been before with major releases. Probably a good sign for maturity...
Great episode, actually haven't seen it until it was referenced in episode #415.
However, if rails 4's default behavior will now rely on strong parameters instead of attr_accessible, I suppose this episode will become pretty essential rails 4 users. Will you be making this episode public, or will it remain a pro episode?
Rails 4 syntax is less verbose and more intuitive when writing queries.
Rails 4 has a heavy emphasis on security.
There are several more features covered in various blogs and podcasts.
To summarize, Rails 4 "feels" more mature.
I took a huge commercial app and was able to upgrade it from Rails 3.2.13 to Rails 4.0.0.rc1 in half a day. Having the test suite in place made the transition process go smoothly. There are a few popular gems that we use that are not Rails 4 ready so releasing this upgraded app to production will have to wait.
I agree w/ @kikorb. The scary thing is what happens when a relative noob (like myself) tries this. A checklist might be one way of looking for all the gotchas.
Are there any big advantages to upgrading to Rails 4 - I'm a little familiar with some of the new features that are offered and none of them sound appealing to me at the moment.
You can generate a new secret_key_base by running rake secret.
If you're interested in some more details about Rails 4 (and deeper dives on some of the topics shown), I'm writing an e-book: http://upgradingtorails4.com/
How unfortunate that ActiveModelSerializers are nothing more than views without templates. If they were coupled with deserializers, that would be a real difference. Recently I'm trying Roar which is basically the same thing, but works in both directions.
Yeah, web APIs are (or should be) sticklers for proper status codes, but any ol' HTML browser can infer a lot from the status code too. Whether or not to use the URL when auto-completing an address for the user, for instance. It's annoying to have the browser remember a URL for an error page, only because that page accidentally sent a 200 OK
Given the changes with Redcarpet, I was not able to get the steps in this Railscast to work. But, I used it to help me understand what I was looking at in figuring out what to do next. I got Redcarpet working with my Rails 4, RC1 blog. If you'd like steps, you can peek at it here:
http://www.hamcois.com/articles/4
To get the latest Rails config settings there's no need to copy/paste from another project just run
rake rails:update
.If the only reason they're not switching is because they already have an account, then they're probably not that grumbly. We're talking about subtle unconscious cues that influence the stats in otherwise unnoticeable ways here, not torturing users and tying a lease around their neck.
I struggled a bit, while converting my rails-api app to use ActiveModelSerializer, on how to modify my specs to check for the JSON coming back (without doing something ugly like hard coding them).
Thanks to Ryan for this RailsCast - it got me to take a look at active_model_serializer, as shown at the end of the asciicast, and using that in my tests simplified things.
You can see my conversion to active_model_serializer in this commit, including my request spec changes.
I have really gotten a ton out of Ryan's work. It's helped me immensely learning Rails and I still know nothing.
I put together a small instructional guide for those who want to use dataTables with Twitter Bootstrap. My environment is Rails 4, RC1.
Anyway, hope this helps. As it's long, I'll link it, but I can post it here if that's more appropriate.
http://www.hamcois.com/articles/3
He gave the example of what this would look like with Capistrano. What if I just want to run it locally to test it out? Also, how do you deploy it to the server if you are not using Capistrano?
+1
Seems that you've answered my question ... Thanks !
Now you can watch this RailsCast for the answer ;)
Processing by PagesController#show as
Parameters: {"id"=>"favicon"}
Page Load (0.2ms) SELECT "pages".* FROM "pages" WHERE "pages"."permalink" = 'favicon' LIMIT 1
Can someone tell me why the get ':id', to: 'pages#show', as: :page route in my route.rb file is passing favicon as an id parameter?
+1 ASCII-cast
Thanks for this Ryan.
I have a problem, every chart that I want to draw will be in "Line charts".
even when I put
chart: {
renderTo: 'container1',
type: 'bar'
},
it will in "Line charts" not in 'bar'.
thanks a lot
Hello, could you please asciicastize it? Thanks! :-)
Thanks Florent. Exactly what I was looking for. :)
I can't seem to be able to access "current_user" in the Serializer.
Error:
undefined local variable or method `current_user' for #PostSerializer:0x5bcd9af2
The current_user is available in my controllers and views. (jRuby on Rails with Devise)
Does anyone have an idea why this might be?
I am using windows on my development machine ,,,any one having experience on adding ssl while developing on windows ,,please help me ..thanks
Is the inaccessible current_user problem still true ?
the Purpose section of AMS readme says
"Serializers know about both a model and the current_user" so...
(installing the gem now to try it out though !)
Thanks Ryan !
Hi, when I click the reset password button its giving me a validation error saying Validation failed: Password can't be blank?
Any help? I'm quite new to this?
Anyone know how to add stopping/starting the script/mailman_server to Rubber?
+1
This doesn't work for me. I still get a 401. I also tried http://127.0.0.1:3000/auth/twitter/callback to no avail.
This worked for me: http://stackoverflow.com/questions/14797935/using-angularjs-with-turbolinks
Hi I just want to ask on how to configure live email account by Microsoft on
how about the live email account configuration that is similar with gmail smtp configuration?
example
username: myemail@live.com
password: SamplePassword
Thanks!
Great post! Thanks, there's quite a lot to see.
confirmed - got my invite today! let's play...
I eventually went with something like this. Works well for me.
Great stuff.
What about the sqlite :memory: database ? I have been using this since months for my tests, just to speed up the database transactions without having to change the specs. Not sure how big the gain is in the current rails but it was a big improvement once.
Thanks for the cast Ryan you spelt it well as usual. But somehow I share that kind of disappointment with Cyle. It is not if anything were missing, it is just there is no big Wow as there has been before with major releases. Probably a good sign for maturity...
I did not know about Railsdiff. It's fantastic.
Great episode, actually haven't seen it until it was referenced in episode #415.
However, if rails 4's default behavior will now rely on strong parameters instead of attr_accessible, I suppose this episode will become pretty essential rails 4 users. Will you be making this episode public, or will it remain a pro episode?
you misspelled omniauth ... you wrote 'ominauth'
user = User.from_omniauth(env["ominauth.auth"])
To quickly view differences between Rails versions:
http://railsdiff.org/html/v3.2.13-v4.0.0.rc1.html
so painful
Here's a sudo template helper method to keep your code... DRY
Put it in
config/recipes/base.rb
I noticed 2 areas of improvement:
Rails 4 syntax is less verbose and more intuitive when writing queries.
Rails 4 has a heavy emphasis on security.
There are several more features covered in various blogs and podcasts.
To summarize, Rails 4 "feels" more mature.
I took a huge commercial app and was able to upgrade it from Rails 3.2.13 to Rails 4.0.0.rc1 in half a day. Having the test suite in place made the transition process go smoothly. There are a few popular gems that we use that are not Rails 4 ready so releasing this upgraded app to production will have to wait.
AWESOME article ...worked like a charm except one change.
If you installed RoR using RailsInstaled make this SSL fix.
https://gist.github.com/fnichol/867550
I used the same pattern to allow sign in with LinkedIn
Use this gem "omniauth-linkedin-oauth2"
and use this provider :
config.omniauth :linkedin_oauth2, ENV["LINKEDIN_KEY"], ENV["LINKEDIN_SECRET"]
Also you can get the email address from the session so that the user will be automatically created.
In user.rb model class self.from_omniauth method add this line
user.email = auth.info.email
Thanks for these non-so-intuitive step :)
awesome, was just wondering that.
resource has controller
I agree w/ @kikorb. The scary thing is what happens when a relative noob (like myself) tries this. A checklist might be one way of looking for all the gotchas.
Thanks Ryan.
There is no need to say how many unproductive hours and nightmares you are avoiding us with episodes like this one.
Are there any big advantages to upgrading to Rails 4 - I'm a little familiar with some of the new features that are offered and none of them sound appealing to me at the moment.
You can also rename
update_attributes
toupdate
Very nice summary!
You can generate a new
secret_key_base
by runningrake secret
.If you're interested in some more details about Rails 4 (and deeper dives on some of the topics shown), I'm writing an e-book: http://upgradingtorails4.com/
How unfortunate that ActiveModelSerializers are nothing more than views without templates. If they were coupled with deserializers, that would be a real difference. Recently I'm trying Roar which is basically the same thing, but works in both directions.
Yeah, web APIs are (or should be) sticklers for proper status codes, but any ol' HTML browser can infer a lot from the status code too. Whether or not to use the URL when auto-completing an address for the user, for instance. It's annoying to have the browser remember a URL for an error page, only because that page accidentally sent a
200 OK
Hi all,
It seems like the Paypal website is now working differently.
Is there a revisited version of this tutorial ?
Thx !
Nice Video..! Cheers.
Yeah, I agree. It's a great introductory topic. But there are lots of things to cover.
So either a good topic for a long episode or a series of two. Or maybe I've written too many git-specific things?
thank you
Cool video. Wanted to try out 4.0 (aka First)