ActiveRecord::Migration.new.add_column :payments, :card_verification, :string, limit: 8 ActiveRecord::Migration.new.execute "full sql here"
Tech stuff around computer programming, basically for web development, especially opensource. Topics will go round Ruby on Rails (git gems etc.), Ubuntu (admin and basic shell) and work organization (agile philosophy)
Tuesday, 31 July 2012
Change the db with migrations on the fly
What if you want to add a column though the console with one line of code? (and you exactly know what this implies)
Saturday, 14 July 2012
Coffescript rendering
The correct way to render html inside your XHR response in Rails.
app.showFlashMessages('<%=j flash_messages %>') $('.booking').replaceWith( '<%=j render @booking %>' ) app.myFunction( <%=raw array.map(&:to_json) %> ) # TODO: double check
Subscribe to:
Posts (Atom)