#helpers
8 posts tagged helpers. Clear filter
-
How To Write Your Own Time Comparison Function in Ruby Like time_ago_in_words Without Rails
-
Rails Select Tag and Onchange Event Calling a Remote Function with Default Option Selected
Here is a little code snippet that will fire off a request to update\client\path when you change the select field. This stands alone, rather than being apart of a larger form. The Client::CATEGORY...
-
Collection Select Helper and OnChange Event in Rails
Given a collection of Active Record objects, you may use the collection\select helper method to produce a select form field. You need to pass in a number of arguments to the helper function. 1)...
-
Yield a Block within Rails Helper Method with Multiple Content_tags Using Concat
To clean up some repetitive html coding in views, pass a block of text to a helper function which will wrap it for you the same way, each and every time. For example, I have a 'help' link which...
-
Rails Helper to Remove Leading Zero in 12 Hour Time Format
I can't find a strftime() format that will output the hour without the leading zero. For instance 6:20 will be instead 06:20. This just looks a little sloppy. I created a datetime.rb intializer...
-
Date and Time Helpers in Rails
Just for reference http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.htmlM001695
-
Make Rails Lib Module Methods Available to Views
If you create a module in the lib/ directory of your Rails application you won't have access to those methods in your views. If you don't want to put those methods in a helper file, you need to add...
-
Rails Prototype JS and TinyMCE Autosave
TinyMCE is a nice little WYSIWYG for text processing online. It uses iFrames and Javascript callbacks to manipulate textarea form fields. Using it with Rails can be somewhat problematic if you want...