Please read for an updated status on RailsCasts:
Learn more or hide this
GitHub User: semaperepelitsa
I find it better to put the global scope directly into the controller:
def scope_current_tenant &block
Topic.with_scope Topic.where(tenant_id: current_tenant.id), &block
That way everything outside it will work the same way as before.
Did you see turbolinks? Looks like you are developing the same thing.
Anyone had luck with using jQuery File Upload UI in Rails?
DELETE /products/1/delete looks rather confusing, I think it is better to use POST verb in this case: POST /products/1/delete. Also, these are perfectly valid RESTful routes, there is nothing wrong with them.
I would also suggest to extend your routing DSL explicitly instead of patching Rails internal classes so that the modification is obvious for you and others. This will also avoid troubles with external engines that will expect default behavior.
def resources(*args, &block)
yield if block_given?
delete :delete, action: :destroy
root to: 'products#index'
I have used ActiveModel::Serializers::JSON module to make a serializer/presenter class and I like this approach better than Jbuilder.
There is XML Builder that comes bundled with Rails ("builder" gem)
You can skip require "rubygems" since Ruby 1.9
This is why we are saving them into a separate variable
states = $('#person_state_id').html()
But when you get out of it in production you'd better have a well-tested billing system :-)
Since jQuery 1.6 you should use prop() method to set boolean attributes: $('input[type=submit]').prop('disabled', true)
There is no PayPal yet in my work, but it was interesting to watch this episode. One thing that bothers me though is that you skip testing part which is crucial in billing and payments. I know, the episode would be two times longer if you covered this as well but it was very scary to see you just quickly testing the stuff in a browser.
root to: "public#welcome"
constraints subdomain: /.+/ do
root to: "sites/public#welcome"