Jump to content

The ultimate community for Ruby on Rails developers.


Photo

autosize-rails gem

autosize gem textareas

  • Please log in to reply
1 reply to this topic

#1 larabosa

larabosa

    Signalman

  • Members
  • 13 posts

Posted 07 October 2013 - 03:40 PM

Hi,

 

I wanted to use the jQuery Autosize plugin for my text areas built with text_area_tag, but first I decided to see if there was a gem already for this and found "autosize-rails".

 

Unfortunately, the documentation does not say how to use the gem:

https://github.com/c.../autosize-rails

 

Has anyone used it?. Is this gem a work-in-progress and it is probably a better idea to download the jQuery plugin and add files under the vendor directory?.

 

Any suggestions/answers will be appreciated.

 

Thanks,

 

Ester



#2 Jamie

Jamie

    Controller

  • Moderators
  • 114 posts
  • LocationThe UK

Posted 13 October 2013 - 09:24 AM

Add the following to your javascripts applicaiton file..

$(document).ready(function(){
    $('textarea').autosize();   
});

http://codepen.io/anon/pen/xBpJl


Rails developer based in Newcastle, UK.
Web app owner - Twitter lover





Also tagged with one or more of these keywords: autosize, gem, textareas

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users