Archive | Rails

05 July 2010 ~ 0 Comments

MarkItUp: Rails plugin that turns any textarea into a markup editor

I recently published a plugin that helps you turn any textarea into a markup editor. It is based on excellent markItUp! jQuery plugin. Example The most simple usage with preset defaults <html> <head> <%= javascript_include_tag “path/to/jquery” %> <%= mark_it_up ‘#miu_test’ %> </head> <body> <% form_tag do %> <%= text_area_tag “miu_test” %> <% end %> </body> [...]

Continue Reading

26 June 2010 ~ 0 Comments

Simple Search Rails plugin

SimpleSearch brings simple search to ActiveRecord. It ads simple_search named scope that accepts query as parameter. The idea is that you provide the query and plugin does the rest (splits query to keywords and compose where statement). This can be very useful in case you just want to filter list of records by some query, [...]

Continue Reading

25 February 2010 ~ 2 Comments

Create new app with specific Rails version

I recently installed Rails 3 beta release but I needed to create new app with the 2.3.5. version. I was searching for a way to do that and I found this rails _2.3.5_ appname Unfortunately this will produce an error similar to this /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:827:in `report_activate_error’: RubyGem version error: railties(3.0.0.beta not = 2.3.5) (Gem::LoadError) from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:261:in [...]

Continue Reading

Tags: , ,

04 January 2010 ~ 0 Comments

Ruby library for parsing, validating and formatting phone numbers

Tomislav Car has just released Phone, Ruby library for phone number parsing, validation and formatting. It should save you a lot of time if you need any of the following: * you have area where users input phone numbers in many different formats * output phone numbers in specific format * you need to send [...]

Continue Reading

02 January 2010 ~ 0 Comments

Rails, CSRF and Ajax requests

Rails protects controller actions from CSRF (Cross-Site Request Forgery) attacks with a token based on a random string stored in the session. The token parameter is named authenticity_token by default and will be embedded in all forms and Ajax requests generated by Rails. You should also add this token to all Ajax request that you [...]

Continue Reading

19 September 2009 ~ 0 Comments

Radiant CMS, disable caching in development

I am working on extension for Radiant CMS. I wanted to disable caching for development, but wasn’t able to find right method for this, so finally I did it by putting this into my extensions activate method if RAILS_ENV==”development” Page.class_eval { def cache? false end } end This is more of a hack then a [...]

Continue Reading