diff --git a/app/adapters/category-slug.js b/app/adapters/category-slug.js new file mode 100644 index 00000000000..109a6447095 --- /dev/null +++ b/app/adapters/category-slug.js @@ -0,0 +1,11 @@ +import ApplicationAdapter from './application'; +import Ember from 'ember'; + +export default ApplicationAdapter.extend({ + pathForType(modelName) { + var decamelized = Ember.String.underscore( + Ember.String.decamelize(modelName) + ); + return Ember.String.pluralize(decamelized); + } +}); diff --git a/app/models/category-slug.js b/app/models/category-slug.js new file mode 100644 index 00000000000..167c436b97c --- /dev/null +++ b/app/models/category-slug.js @@ -0,0 +1,5 @@ +import DS from 'ember-data'; + +export default DS.Model.extend({ + slug: DS.attr('string'), +}); \ No newline at end of file diff --git a/app/router.js b/app/router.js index e65d3ea9a4f..ee35611828b 100644 --- a/app/router.js +++ b/app/router.js @@ -39,6 +39,7 @@ Router.map(function() { this.route('category', { path: '/categories/:category_id' }, function() { this.route('index', { path: '/' }); }); + this.route('category_slugs'); this.route('catchAll', { path: '*path' }); }); diff --git a/app/routes/category-slugs.js b/app/routes/category-slugs.js new file mode 100644 index 00000000000..8416e4d23d6 --- /dev/null +++ b/app/routes/category-slugs.js @@ -0,0 +1,12 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ + queryParams: { + page: { refreshModel: true }, + sort: { refreshModel: true }, + }, + + model(params) { + return this.store.query('category-slug', params); + }, +}); diff --git a/app/templates/category_slugs.hbs b/app/templates/category_slugs.hbs new file mode 100644 index 00000000000..6e36210b1c2 --- /dev/null +++ b/app/templates/category_slugs.hbs @@ -0,0 +1,14 @@ +{{ title 'Category Slugs' }} + +