Profile
Achievement
vanne's Recent Ruby Snippets
- All /
« Prev 1 Next »
Since there is no convenient way to clear the console in irb on windows, we can simple emulate the dos cls function
1
1693
posted 16 years ago by vanne
This is an easy to use any helpers that rails provides in any other place besides views and view helpers
1
601
posted 17 years ago by vanne
Put this in environment.rb to use in your whole app or the console
1
641
posted 17 years ago by vanne
This allows you to search any INSTANCE or CLASS methods of any objects including rails models, which is helpful if you want to see the methods that you created yourself.
1
533
posted 17 years ago by vanne
Add this inside your .irbrc file to call "show Model" in your console instead of "y Model.column_names"
1
566
posted 17 years ago by vanne
Add this to your ~/.irbrc file and you will have inline logging in the console
1
560
posted 17 years ago by vanne
Use this to sanitize a string and convert all wierd characters to your choice of delimiter
1
672
posted 17 years ago by vanne
A custom assertion that will allow you to pass a block to find the difference between two values.
1
489
posted 17 years ago by vanne
Useful for when you need to do a find and map specific results to an array for use later
1
622
posted 17 years ago by vanne
This is useful for using ActiveRecord validations without the ActiveRecord DB dependencies, this snippet is meant to be used with Textmate... create this in models/name_of_your_model to use.
4
974
posted 17 years ago by vanne
This allows you to turn off ajax requests application wide, so that you don't have to do render :layout => false in every controller that needs it.
1
828
posted 17 years ago by vanne