Get the address in php.
bardzo_zielony_dev
środa, 14 września 2011
sobota, 27 sierpnia 2011
WTF is mocha?
mocha:
https://github.com/floehopper/mocha
http://agilewebdevelopment.com/plugins/mocha
http://www.ibm.com/developerworks/web/library/wa-mockrails/index.html
http://www.ibm.com/developerworks/web/library/wa-rspec/index.html
http://yarorb.wordpress.com/2007/11/26/mocks-and-stubs-in-ruby-on-rails-the-mocha-solution/
https://github.com/floehopper/mocha
http://agilewebdevelopment.com/plugins/mocha
http://www.ibm.com/developerworks/web/library/wa-mockrails/index.html
http://www.ibm.com/developerworks/web/library/wa-rspec/index.html
http://yarorb.wordpress.com/2007/11/26/mocks-and-stubs-in-ruby-on-rails-the-mocha-solution/
Files
file uploading:
http://www.tutorialspoint.com/ruby-on-rails/rails-file-uploading.htm
in pdf
http://railscasts.com/episodes/134-paperclip?autoplay=true
https://github.com/thoughtbot/paperclip
Encripting files:
http://onehub.com/blog/posts/encrypting-your-files-with-rails-part-i-2/
http://onehub.com/blog/posts/encrypting-your-files-with-rails-part-ii/
Hirb, to see nicer tables in irb (rails c)
You have to add gem 'hirb' in the gemfile
https://github.com/cldwalker/hirb
http://www.tutorialspoint.com/ruby-on-rails/rails-file-uploading.htm
in pdf
http://railscasts.com/episodes/134-paperclip?autoplay=true
https://github.com/thoughtbot/paperclip
Encripting files:
http://onehub.com/blog/posts/encrypting-your-files-with-rails-part-i-2/
http://onehub.com/blog/posts/encrypting-your-files-with-rails-part-ii/
Hirb, to see nicer tables in irb (rails c)
You have to add gem 'hirb' in the gemfile
https://github.com/cldwalker/hirb
środa, 24 sierpnia 2011
unit testing and inheritance
In my project I have Single Table Inheritance (STI). Example of STI. type:string is very important!!!
I came across an error while I tried the unit testing:
Problem:
I came across an error while I tried the unit testing:
Problem:
test_the_truth(AdminTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: clients: DELETE FROM "clients" WHERE 1=1
Solution1:
delete the fixtures of chlid models, in this case table 'clients'
Solution2:
add name of the fixtures one want to add in each test:
fixtures :clients
and delete line
fixtures :all
from the test_helper.rb
Solution2:
add name of the fixtures one want to add in each test:
fixtures :clients
and delete line
fixtures :all
from the test_helper.rb
binding.pry
Best screencasts about rails: http://railscasts.com
The last episode was about pry. Nice alternative to irb.
http://pry.github.com/
How to change your editor in pry? Let's do this in Ubuntu and switch from nano to vim
Just make/add to a file named '.pryrc' in your home folder
pry -r config/environment
The last episode was about pry. Nice alternative to irb.
http://pry.github.com/
How to change your editor in pry? Let's do this in Ubuntu and switch from nano to vim
Just make/add to a file named '.pryrc' in your home folder
pry -r config/environment
Subskrybuj:
Posty (Atom)