Please read for an updated status on RailsCasts:
Learn more or hide this
The validation part is what I looked for a long time, Ryan, thanks very much.
Very nice! How about revising episode #8 "Layouts and Content For" episode?
That'd be really awesome, I've took it for granted it hasn't changed that much, But I'm betting I'm wrong! I too want to see what awesome things you can do with content_for and content_tag
I have to do the price_in_cents stuff all the time, so I made priceable. Nothing too special, but still handy
I realise that you probably want to keep your examples simple and all in one file, but isn't creating categories or tags within the product model considered 'bad form'?
I'd love to see an episode with your take on the current OOP 'movement' in the Rails community - maybe a discussion on how and when you should use POROs etc.
You did some good episodes on design patterns like presenters etc. but a more general look at OOP would be great. Maybe even a multi-part series where you refactor a more complicated real world app?
Keep up the good work.
+1... I am hoping the next episode will be "Refactoring Virtual Attributes (and eliminating callbacks.)" I've been reading up a lot on this and think an episode will solidify the concepts!
When I first started using Rails, the virtual attributes episodes helped me heaps.
But as time goes, I start seeing my model class getting fatter and fatter, and becoming un-manageable (especially with all those AR callbacks). I guess it's a progressive advancement to start using PORO to move the logic out.
+1 for coverage of the Rails OOP movement & how to achieve fast tests
I would really like to see that also.
Btw, don't you guys think that many of these methods could be extracted into a Presenter?
Since they all affect the presentation of the information (they do not modify the data itself), I think would be much better to see it on a Presenter.
The same is not valid to Tag/Category creation, of course.
Not Ryan's take, but Gary Bernhardt at Destroy All Software has some great screencasts along those lines.
Tip: to check if a value is set on a field, Rails provides you with methods that end with a question mark. So your price_in_dollars method will look like this:
price_in_cents.to_d/100 if price_in_cents?
It's a small but neat change.
Also, speaking of prices, there is an excellent gem called money-rails for handling that: https://github.com/RubyMoney/money-rails
I, too, would like to see this. Otherwise, great episode, as always!
First of all: Great episode as always!
But I've got a question:
I tried to use the example from this episode with the creation of a new category in my app. I use internationalization there. Has anybody an idea how I could add the correct label to my text_field, without duplication inside my locales?
Does creating a new category belong in the model? - It seems a bit weird to have it in the model rather than the controller, or is it just me?
I have many price fields (monthly, average, total etc).
Can these getter/setter methods be rewritten for use with all my fields?
Wouldn't it be a good move to make the validation method private?
Virtual attributes don't activate callback functions in Rails 3.2.8
What am I missing? I cannot have a hour and min field convert to a duration model field.
attr_accessible :date, :hour_dur, :min_dur
attr_accessor :hour_dur, :min_dur
duration = hour_dur*60 + min_dur
duration / 60 if duration.present?
duration % 60 if duration.present?
masalah baja dalambaja lingkungan pengerasan Fittingbaja besi http://chnm.gmu.edu/cyh/myomeka/posters/show/21485 hidupbaja cukup baja besi kaku kirakira jarak http://chnm.gmu.edu/cyh/myomeka/posters/show/21492
cukup ketat baja cetakan atas menekan besi http://chnm.gmu.edu/cyh/myomeka/posters/show/21496 modulus lainbaja baja diperlukan alasan kerugian besi http://chnm.gmu.edu/cyh/myomeka/posters/show/21497
sepanjang baikbaja struktur baja besi selesai tahu http://chnm.gmu.edu/cyh/myomeka/posters/show/21500 besi teknik baja adalah kami ke tidakbaja http://chnm.gmu.edu/cyh/myomeka/posters/show/21506
besi derek ofaircraft baja selanjutnya dibandingkan memungkinkan http://chnm.gmu.edu/cyh/myomeka/posters/show/21510 memerlukan baja konstruksi plastik berbentuk besi kami http://chnm.gmu.edu/cyh/myomeka/posters/show/21511
besi baja pramengeras konstruksibaja konstruksibaja maka manfaat http://chnm.gmu.edu/cyh/myomeka/posters/show/21513 perusahaan besi baja radiusbajathe biasanya 3tinggi keramik http://chnm.gmu.edu/cyh/myomeka/posters/show/21517
besi sehubungan Gedung bumi halusbaja baja listrikresistensi http://chnm.gmu.edu/cyh/myomeka/posters/show/21522 besi baja inginkan diversifikasi fiturfitur luasbaja Stockist http://chnm.gmu.edu/cyh/myomeka/posters/show/21523
besi mampu baja menarik Selain tabung mandrel http://chnm.gmu.edu/cyh/myomeka/posters/show/21525 kekurangan texturing dipangkas baja sekarangbaja menonjol besi http://chnm.gmu.edu/cyh/myomeka/posters/show/21530
besi mudah cor h13 mandrelbaja baja vakum http://chnm.gmu.edu/cyh/myomeka/posters/show/21534 besi tertarik penurunan kebutuhan baja diingatbaja ingin http://chnm.gmu.edu/cyh/myomeka/posters/show/21535
struktur kita penampang baja gempa besi http://www.ifesp.edu.br/ead/blog/index.php?entryid=409 kegunaandie besi baja mereka dimensi tikungan pangkalan http://www.ifesp.edu.br/ead/blog/index.php?entryid=414
mati? baja mandrel digunakan diingatbaja dengan besi http://www.ifesp.edu.br/ead/blog/index.php?entryid=417 ritel rasio menggunakanstamping pakai besi baja bila http://www.ifesp.edu.br/ead/blog/index.php?entryid=418
populer baja berbantuan meningkatkan biayaefektifbaja konstruksibaja besi http://www.ifesp.edu.br/ead/blog/index.php?entryid=420 pertama baja tegak akhir polishability dilas besi http://www.ifesp.edu.br/ead/blog/index.php?entryid=424
kedua metode baja webbaja meyakinkan menyarankan besi http://www.ifesp.edu.br/ead/blog/index.php?entryid=427 pilihan mulus baja besi Anda domisili energi http://www.ifesp.edu.br/ead/blog/index.php?entryid=428
tegak besi 2dingin baja efisien berlindung luarbaja http://www.ifesp.edu.br/ead/blog/index.php?entryid=430 tetapi besi membahas pipabaja baja pengeboran manfaat http://www.ifesp.edu.br/ead/blog/index.php?entryid=434
besi baja sendiribaja menekan dimasukkan penampang fantastis http://www.ifesp.edu.br/ead/blog/index.php?entryid=437 baja besi angin dapat diameter menjadi dinamai http://www.ifesp.edu.br/ead/blog/index.php?entryid=438
langitbaja bingkai tersebut kimia baja masa besi http://www.ifesp.edu.br/ead/blog/index.php?entryid=440 kompresi batas penampang baja bahkan tinggi besi http://www.ifesp.edu.br/ead/blog/index.php?entryid=445
penting beroperasi baja baikbaja penambahan lengkunganbaja besi http://www.ifesp.edu.br/ead/blog/index.php?entryid=450 cocok Kelemahan berkas lain baja atau besi http://www.ifesp.edu.br/ead/blog/index.php?entryid=451
Remember what should be remembered
First sign in through GitHub to post a comment.