I have model in my rails application by the name Request
. Now I have integrated Ember inside a particular route in my application not the whole application, not sure if this is relevant information but giving it out anyway just in case. This is my ember routes:
VsRorDev.RequestsRoute = Ember.Route.extend(model: ->
@get("store").findAll "request"
)
This is the template file(requests.hbs)
<h4>This is the index page of reqs</h4>
{{#each model}}
<h4> {{id}} </h4>
{{/each}}
This is the ember model file
VsRorDev.Request = DS.Model.extend
id: DS.attr('integer')
service_id: DS.attr('integer')
due_on: DS.attr('string')
vendor_service_id: DS.attr('integer')
This is the rails controller action in the Admin::EmberRequestsController
def index
Rails.logger.info "********** INSIDE INDEX OF REQUEST*************"
# @requests = determine_what_to_do
@requests = Request.all
render json: @requests
end
This is the serializer
class RequestSerializer < ActiveModel::Serializer
attributes :id, :service_id, :due_on, :vendor_service_id, :workflow_step,:user_id,:created_at,:updated_at,:query,:admin_filter_payment_status_id,:admin_filter_status_id, :admin_filter_source_id, :admin_filter_priority_id,:admin_filter_due_by_id, :admin_filter_type_id, :admin_filter_lead_id, :admin_filter_payment_mode_id, :admin_filter_widget_id, :admin_filter_reminder_id, :agent_id, :deleted_at,:spam
end
The requests by ember are going to localhost:3000/requests
while I want it to go to localhost:3000/admin/ember_requests
. How do I do this?