Questions tagged as 'controller'

2
answers

Controller and services logic with Angularjs

I have some doubts about the logic of the search functions of the controller and the service. Here is an example of service : angular.module("myApp").factory("ProjetosAPI", function ($http, config) { var _getProjetos = function (pagin...
asked by 08.12.2016 / 19:29
1
answer

Procedures after errors should be in the services / validations or in the controller?

In a backend that has separate validation functions to verify the validity of the data, if this data is invalid the procedure (returning a 400 or printing something on the screen, for example) must occur in this validation part or is a task for...
asked by 22.07.2018 / 00:56
1
answer

Controllers and Routes in node js

I wonder if it makes any difference between using only routes , or routes with controllers in node js could someone give me some examples of how to implement routes and controllers on the node using express js ?     
asked by 22.06.2017 / 22:12
1
answer

How to pass more than one parameter to a Controller?

I'm needing support to pass more than one parameter to a Creation Controller. I have some models as below: Usuario : Brings the information of the user who opened the ex call. user_id, user_name Chamado : Brings the title, co...
asked by 19.03.2017 / 22:24
1
answer

Laravel - How to call a different action from store, update, edit?

I created a action but not the default of resource , as I can call it by an action in form as I call update and store . <form method="POST" role="form" action="{!!URL::route('cadastro.store')!!}" > I w...
asked by 02.12.2016 / 00:16
1
answer

How to insert an information of a model that has a Relationship?

I have a list of Products and this listing has the vendor code, I need to enter the vendor name in that listing. My Controller: public ActionResult Index() { IEnumerable<Produto> produtos = db.Produto...
asked by 03.12.2015 / 20:08
1
answer

RoR - Get the strong controller parameters inside the Application Controller

I'm developing a logging process on my system (Rails 5), more specifically within application controller . This process is being created there so that I can add a before_save to the controllers that I want to record logs. Sin...
asked by 30.10.2017 / 18:30
1
answer

How to change an attribute in the bank via a button

I'm creating a small college project in Ruby on Rails and I came across a problem: I have a table called Person and another call Tools . People have many tools and each tool is owned by one person. I need to add a resource...
asked by 12.06.2016 / 01:36
1
answer

Alphabetical order Ruby on Rails

I need to put my category in alphabetical order: @posts_categories = Admin::PostCategory.all     
asked by 19.01.2016 / 17:25
3
answers

Controller with repository, Ioc and DI

I'm trying to implement the recording of the data in my views, and I'm having doubts about how to instantiate my% repository% in my controller, even using dependency injection examples, because in builder of my user repository he expects to rece...
asked by 02.09.2015 / 21:58