Differences in putting a module in /helpers or in /lib?

What are the reasons putting a module in /helpers over the /lib folder in a RoR app?

Are /helpers more controller specific, while the /lib is more general in nature?

-------------Problems Reply------------

I think this is a good question because the MVC notion makes us forget that it's all really just metaphors for us to organize code so we don't get too mixed up. If you need to do some simple formating go with a helper, otherwise probably a module in /lib.

Helpers are strictly for defining methods that you want available in your views. /lib modules can be used for anything and are available throughout the application.

Category:ruby on rails Views:0 Time:2010-10-28

Related post

  • undefined method `form_for' for module `ActionView::Helpers::FormHelper' 2010-02-07

    Argh! Everything has been totally fine, then all of a sudden I started getting this error when I was doing a 'rake db:migrate' And I get the same thing when I try to restart the rails server. rake aborted! undefined method 'form_for' for module `Acti

  • Is there any general purpose perl module with helpers for web applications? 2011-07-01

    Is there a general purpose Perl Module with helpers for web development? Like form-builders, url helper, etc? Based on my searches, I couldn't find anything. I'm already using Mason, but do not want to define my helpers as components from scratch. --

  • What is the difference between Qt OpenGL module and Qt/3D 2011-09-07

    The 3D examples in the Qt Sdk(under opengl)already can demostrated,but without Qt/3D there.So,what is the difference between Qt OpenGL module and Qt/3D? --------------Solutions------------- From the Qt/3D Reference Documentation: Qt/3D is a set of ex

  • What's the difference between a Python module and a Python package? 2011-10-30

    What's the difference between a Python module and a Python package? See also: What's the difference between "package" and "module" (for other languages) --------------Solutions------------- A module is a single file (or files) that are imported under

  • What is the principle difference between Class and Module level subroutines? 2012-06-17

    Lately I've been using the class module to create an event handler in PowerPoint, but I really don't understand the fundamentals behind Class and Module level subroutines. I'm not very savvy when it comes to programming, but I was hoping somebody aro

  • What's the difference between "package" and "module" 2010-09-09

    I use Java where we only have packages. I know there are other programming languages that also include modules. What's the difference? Thanks --------------Solutions------------- It's hard to compare semantics in the void. (What other languages do yo

  • What is the difference beween adding a Module to World vs adding a Class in Cucumber? 2012-04-24

    For example. When working with ruby on rails in cucumber you can do both Example with a Class class Awesome def thing end end World{ Awesome.new } Example with a Module module Awesome def thing end end World(Awesome) Why would I use one over the othe

  • How do I include module into ActionView from the lib directory? 2012-05-02

    I am attempting to add a new module of custom helpers to the ActionView::Base library. I was able to get the module to load from the config/initializers directory but when I load it into the lib, the module is no longer found. I have: # lib/my_templa

  • How do I install a CPAN module site-wide while local::lib is present? 2010-10-22

    I've recently set up a new system and wanted to install Padre to check it out. The Padre install instructions specifically said to install local::lib, so I did so (although I've never had need of it before). I then went on my way installing several o

  • Compilng python3.2 C module, linker asks for 'python26.lib' 2011-12-19

    I'm trying to compile the example visual studio solution that comes with the 3.2 source. I copied the directory up one level as it says to do. I am not using the same visual studio as they used. For some reason I get this: 1>LINK : fatal error LNK

  • Build module with different versions of libs in Maven 2012-02-01

    I have a Netbeans' module (Module.jar) with a lot of dependencies declared on its pom.xml: <groupId>com.company</groupId> <artifactId>module</artifactId> <packaging>nbm</packaging> ... <dependency> <groupI

  • Include js/css module in Rails in vendor/lib dir 2012-02-17

    I have a Rails 3.1 project and I'm trying to include a jQuery plugin that has both js, css and image files and i've put them under vendor/assets/chosen/{images,javascripts,stylesheets} and i've added index.css and index.js to the respective dirs. The

  • Differences between an extension and a module? 2010-02-02

    Both extend the features and functionality of Magento, but could anyone point me out what are the differences between them? As I wasn't able to find a clear explanation. Thank you. --------------Solutions------------- I've finally found the answer. E

  • What is the difference between a module and a script in Python? 2010-06-08

    Think the title summarizes the question :-) --------------Solutions------------- A script is generally a directly executable piece of code, run by itself. A module is generally a library, imported by other pieces of code. Note that there's no interna

  • Difference between Module & Component in Joomla 2010-06-28

    I am a newbie in Joomla. Can somebody please tell me what is the basic difference between the module & component in Joomla? If possible, please tell with some examples, so that it is easily understood. --------------Solutions------------- heyho,

  • what's the difference between ASP.NET controls and Html.helpers in ASP.NET MVC? 2011-01-30

    I'm completely new to C#, asp.net and asp.net mvc. I'm just starting and trying. so here is my question: what's the difference between ASP.NET MVC Html.helpers and ASP.NET Controls? I know they both can be used to create forms in a page, but what's t

  • Difference between module and closure 2011-03-26

    I am not experienced with javascript. I am wondering what's the difference between closure and module? Can anyone explain to me with a example? --------------Solutions------------- Read this: Closure for Dummies A module is just a class that can stan

  • How can I use my Sinatra helpers in included modules? 2014-03-12

    I have my routes and helpers defined in external files and included by Sinatra, however I'm new to Ruby and I can't now figure out how I can use my helper methods in my routes. When I run the code in RubyMine and access a profile URL I get the error

  • what is the difference between jndi binding of module and app in Java ee 6/7? 2015-03-13

    We migrated from Jboss EAP 5 to EAP 6 in our development environment. I now see the following in my JBOSS logs. I am trying to understand how this binding happens. I have read JBOSS docs on JNDI namespace binding. Still I am not totally clear how it

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.067 (s). 11 q(s)