Rails for Django developers
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,719
On Slideshare
1,715
From Embeds
4
Number of Embeds
2

Actions

Shares
Downloads
7
Comments
0
Likes
1

Embeds 4

https://twitter.com 3
http://www.hanrss.com 1

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

Transcript

  • 1. Rails for Django Devs Agiliq.com - Building Amazing Apps
  • 2. Why?1. Polyglot-ism is good2. Not a Django vs Rails tutorial Agiliq.com - Building Amazing Apps
  • 3. Why?1. Rails is an influential framework and manylibraries have been inspired by it. Eg Backbone.2. Lot of great libraries and knowing rails wouldhelp you port them rather than start fromscratch. Eg we built Django-Merchant afterlooking through the API of active merchant.3. Eg. South, Arel Agiliq.com - Building Amazing Apps
  • 4. Good ideas to pick up from Rails1. Asset Pipeline2. Better way to write template tags3. Simplified routing Agiliq.com - Building Amazing Apps
  • 5. You say MTV, I say MVC app_name/models.py app/models/models_ name.rb app_name/views.py app/controllers/contro ller_name.rb templates/app_name/ app/views/view_nam template.html e.erb Agiliq.com - Building Amazing Apps
  • 6. ModelsAuthoritative Sourceapp_name/models.pyDatabasemodels.py generate the SQL which is thenapplied to DBMigrations update the DB which is thenn usedto auto-generate schema.rb Agiliq.com - Building Amazing Apps
  • 7. Relationships models.ForeignKey belongs_to, has_many models. has_one OneToOneField models. has_and_belongs_t ManyToManyField o_many Agiliq.com - Building Amazing Apps
  • 8. Queryset etc User.objects.create() User.create(..) user.save() user.save! Model.objects.get(id=10) Model.find(10) Model.objects.filter(.. Model.where(.. conditions) conditions) Model.objects.order_by Model.order ("created_at") ("created_at") Agiliq.com - Building Amazing Apps
  • 9. Routing urls.py config/routes.rb Regex based DSL based Agiliq.com - Building Amazing Apps
  • 10. Some More Mappings. python manage.py runserver rails server python manage.py shell rails console python manage.py syncdb && python rake db:create && rake db:migrate manage.py migrate Agiliq.com - Building Amazing Apps
  • 11. Things not to learn from Rail1. Too much autogenerated code2. Django forms API is much cleaner3. All models fields are nullable by default Agiliq.com - Building Amazing Apps
  • 12. Resources1. rubyonrails.org2. guides.rubyonrails.org3. ruby.railstutorial.org Agiliq.com - Building Amazing Apps
  • 13. About AgiliqPython Software consulting company. Small op Agiliq.com - Building Amazing Apps