Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4023682
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:37:42+00:00 2026-05-20T10:37:42+00:00

I have a view helper file, app/helpers/analysis_helper.rb, whose toplevel methods I’ve been using in

  • 0

I have a view helper file, app/helpers/analysis_helper.rb, whose toplevel methods I’ve been using in various view files. Works fine. I then defined an AnalysisSummary class inside analysis_helper.rb to package up some view-specific functionality.

However, when I try to instantiate an AnalysisSummary in a view file, I get the error:

uninitialized constant ActionView::CompiledTemplates::AnalysisSummary

Perhaps Rails is telling me that I shouldn’t be defining a class inside a helper file? If so, where would you suggest parking AnalysisSummary? It’s not a controller, it’s not a model…

Thanks.

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:37:43+00:00Added an answer on May 20, 2026 at 10:37 am

    Why does it need to be a class? Why not just a collection of methods? That’s what a helper is: a collection of helpful methods. Business logic does not belong in helpers. You can place your code in a module within the helper file if you want to give some more structure and organization, though.

    You can put classes in app/models without it having to be an ActiveRecord class, but you should seriously consider what the purpose of your class is before you place it there.

    If it concerns only rendering the view, and not accessing data directly, it belongs in the view or a view helper.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two helper methods inside a custom View which are called by their
I have created this file at My/View/Helper/FormElement.php <?php abstract class My_View_Helper_FormElement extends Zend_View_Helper_FormElement {
I have finally got a zend view helper working using this in my helper
I have a view helper that manages generating thumbnails for images. The images are
In my rails project I have a presenter method that has a helper view
I have view stack in a app like so: <mx:ViewStack id=viewStack left=0 right=0 top=0
Our iOS app has a Web View that is rendering pages from file: URLs.
I have been trying to fix this problem for hours. My app keeps crashing
I have one java script definition in view(.phtml) file. This java script has dynamic
please help with the following:(using rails 3 and jquery) In my view i have:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.