Your SlideShare is downloading. ×
rails best pratice from feedback
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

rails best pratice from feedback

723

Published on

this is conclusion about experiences from feedback

this is conclusion about experiences from feedback

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
723
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • So we can use built -in validation of reviewing model.like validatonpresenence and uniquecann't be the same guy for reviewee and reviewerCompare with code of last slide
  • Transcript

    • 1. Rails Best Practices From Feedback
    • 2. Move finder to scope or method
    • 3. Move finder to scope or method
    • 4. Use model callback
    • 5. Use model callback
    • 6. Move Model Logic to Model
    • 7. Move Model Logic to Model
    • 8. Overuse route customizations
    • 9. Overuse route customizations
      Using Namespace
      Further , it can be applied to PermissionManagerController
      http://guides.rubyonrails.org/routing.html#controller-namespaces-and-routing
    • 10. Metaprogramming
      How about all_cmts,all_hrs,all_employees ….WOW!
    • 11. Metaprogramming
      role.hr?
      Role.all_cmts
    • 12. Law of Demeter
    • 13. Law of Demeter
    • 14. Use virtual attributes
      How come that person doesn’t hold a ‘role’ attribute?
      What if we can do add one?
    • 15. Use virtual attributes
      railscasts.com/episodes/16-virtual-attributes
      railscasts.com/episodes/167-more-on-virtual-attributes
    • 16. Favor helper_method
    • 17. Favor helper_method
    • 18. Favor helper_method
      Maybe …..
    • 19. Move View logic to Helper
    • 20. Move View logic to Helper
    • 21. Replace instance variable with local variable
    • 22. Permission Check
      http://hobocentral.net/
    • 23. Permission Check
      What’s more ..
    • 24. Rails Best Practice Gem
      https://github.com/flyerhzm/rails_best_practices
      http://www.ihower.tw/
    • 25. Thanks

    ×