Sha256: 4e98cee1d460a1b5082755d6b647d08ed91ec7c7dd62a2a76789c377e7351b8c

Contents?: true

Size: 1.11 KB

Versions: 6

Compression:

Stored size: 1.11 KB

Contents

Ext.define('FastUI.view.Rest', {
    constructor:function (entity_class) {
        this.entity_class = entity_class;
        this.ext = '.json';
        this.path = this.entity_class.underscore().pluralize();
    },
    getClassName:function(){
        return this.entity_class.demodulize();
    },
    getTableName:function(){
        return this.getClassName().underscore();
    },
    getKey:function(){
        return this.getTableName() + '_id';
    },
    getTitle:function(){
        return this.getTableName() + '_title';
    },
    newPath:function(){
        return this.path + "/new" + this.ext;
    },
    editPath:function(id){
        return this.path + "/" + id + "/edit"+ this.ext;
    },
    showPath:function(id){
        return this.path + "/" + id + this.ext;
    },
    updatePath:function(id){
        return this.path + "/" + id + this.ext;
    },
    createPath:function(){
        return this.path + this.ext;
    },
    indexPath:function(){
        return this.path + this.ext;
    },
    deletePath:function(id){
        return this.path + "/" + id + this.ext;
    }
});

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fastui-0.1.8 app/assets/javascripts/fastui/app/view/Rest.js
fastui-0.1.7 app/assets/javascripts/fastui/app/view/Rest.js
fastui-0.1.6 app/assets/javascripts/fastui/app/view/Rest.js
fastui-0.1.4 app/assets/javascripts/fastui/app/view/Rest.js
fastui-0.1.3 app/assets/javascripts/fastui/app/view/Rest.js
fastui-0.1.2 app/assets/javascripts/fastui/app/view/Rest.js