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 1061973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:33:13+00:00 2026-05-16T18:33:13+00:00

I currently have a model that the user can upload a thumbnail to the

  • 0

I currently have a model that the user can upload a thumbnail to the record which is then shown on the show view page. This thumbnail was originally intended so the user could easily find the case when searching through the index view table of records.

It has become apparent that users are only using this function to upload a thumbnail of the year – for example, they have uploaded a red square with 10 in for each case with a reference number of M10-XXX.

So I was wondering if it’s possible to add a helper to the kase model to output an image if the kase reference starts with M10. I could then include in the same helper the image for 2011, 2012 and so on.

At the moment the kase show view calls the uploaded thumbnail:

<% if @kase.avatar.exists? then %>
            <%= image_tag @kase.avatar.url %>
        <% else %>
            <img src="../images/document.jpg" alt="Document" />
        <% end %>

What I would like to do, is add a helper such as:

def kase_thumb k 
  if k.jobno.to_date == Date.today then
    <img src="images/10.png" alt="2010" />
  else 
    <img src="images/no-year-found.png" alt="2010" />
  end
end

Obviously the above wouldn’t work because the standard jobno would be M-XXX where is replaced with the last two digits of the current year.

Is is possible to have a helper method that extracts the first two numbers, but ignores the first letter?

I did think about doing this with the date created, but people may retrospectively add cases to the application.

Thanks,

Danny

  • 1 1 Answer
  • 0 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-16T18:33:14+00:00Added an answer on May 16, 2026 at 6:33 pm

    Given the string of the case number/identifier:

    number = the_case_id[1,2].to_i
    

    Hope this helps.

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

Sidebar

Related Questions

I have a client app that can upload some data via a WCF service.
So, I'm working on an app where users can upload and manage photos with
I have 2 scenarios that I need some help with re validation in my
QUESTION Which of the Youtube Data API auth methods will allow me to upload
I have a Silverlight Windows Phone 7 app that pulls data from a public
I have a Rails 3 site I'm working on that has users who operate
I'm building the data model for the website of a student club at my
I am using Codeigniter with the TankAuth library installed and trying to upload to
I am writing a solution in Excel that uses a number of linked data
we are using django to develop a customer-management application, and we need to set

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.