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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:37:46+00:00 2026-05-29T03:37:46+00:00

The CRUD module cannot convert the meaningful class name in play framework. For example,

  • 0

The CRUD module cannot convert the meaningful class name in play framework. For example, if i have a Category model and then make a Categories class in the controller folder to extend CRUD, the Category link will not appear in the admin section. However, if i rename the file into “Categorys”, it will work. Is there any solution for this small issue ? Because i used to play with CakePhp and it works pretty good with all the name conventions

  • 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-29T03:37:47+00:00Added an answer on May 29, 2026 at 3:37 am

    According to documentation of CRUD module of Play framework

    The controller’s class name has to be the model class name with a final ‘s’.

    However, you could use @CRUD.For() annotation to customize naming of CRUD controller individually:

    package controllers;
    
    import models.Category;
    
    @CRUD.For(Category.class)
    public class Categories extends CRUD {
    
    }
    

    EDIT:

    After a quick skimming through source code of CRUD module, I think model naming resolution is around line 260 in {location of play}/modules/crud/app/controllers/CRUD.java(for version 1.2.4):

    259             String name = controllerClass.getSimpleName().replace("$", "");
    260             name = "models." + name.substring(0, name.length() - 1); 
    

    It simply finds model name by looking for the word without the last character of the controller name. (I just tested it, you could even name your CRUD controller as ‘Categoryz’. And it works just fine)

    So, if you really want to fix this in a ‘conventional’ way, you could modify line 260 of CRUD.java and utilize some library for singular-plural conversion like Inflector in ModeShape. But in my opinion, using @CRUD.For annotation is just fine and more cost-effective.

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

Sidebar

Related Questions

I have a simple application using the Play! framework's secure module. My 'Users' controller
I have a simple Crud application where there is one filed called Category. During
In a rich client CRUD framework I'm working on, I have a so-called edit
I would like to have the EntityFramework4 model (.edmx and .context.tt) in a Class
when trying a search on some entities in the CRUD module of Play I'm
I'm using Crud module and I can make it work well. But when I
In my play! app,I have coded the controllers.Security as class Security extends controllers.Secure.Security {
I have a basic CRUD form that uses PageMethods to update the user details,
I have a CRUD winform App that uses Merge Replication to allow disconnected functionality.
How do you like your CRUD programs. Code-generated, framework-driven, or manually written?

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.