Given code like this:
class RatingsController < ApplicationController
def create
success = RatesBusiness.add_rating(params[:business_id],
params[:score],
current_user)
render json: {success: success}
end
end
Wouldn't it be better something like this (just to adapt to rails)? class RatingsController < ApplicationController
logic = RatesBusiness
end
Or, even better class ApplicationController < Controller
def initialize(logic):
// do something
end
def create:
// do something with the logic
end
end
And adding some routes for each logic.But, then, you could just extract the route from the logic name (and get the rails controller back, that now it would be called "Logic")
My point is that extracting code just for the fun of it seems worthless. What is the rationale in this case?