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

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