devise - Helpers vs controllers in Rails -


i want add function user object, going create user controller (i'm using devise believe should add function existing devise user object). noticed there's folder called 'helpers' in rails project, should putting functions in there instead of inside controller? method enable anonymous sessions, doesn't come out of box devise.

thin controller , fat models. try follow principle when creating rails application. put logic , calculations if needed in models. controllers used controller data pass views , how display data. put methods helps display of views in helpers. e.g. put code formating numbers inside helpers. if want share source code between controllers , doesn't fit models, can create library.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -