We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
While using instance variables for this is a Rails thing, we're not big fans of this. We're thinking about using locals instead, if possible.
Currently we have all these methods that only sets an instance variable:
before_action :set_resource_service before_action :set_resource_class before_action :set_resource_parents before_action :set_resources, only: :index before_action :set_resource, only: [:show, :new, :edit, :create, :update, :destroy]
Look into if it's possible to do something like:
def index locals = index_locals respond_to do |format| format.html { locals: locals } format.json { locals: locals } format.csv { locals: locals } end end protected def index_locals { resource_service: resource_service, resource_class: resource_class, resources: resources } end
Discussion regarding using locals: thoughtbot/guides#398, https://thepugautomatic.com/2013/05/locals/
The text was updated successfully, but these errors were encountered:
No branches or pull requests
While using instance variables for this is a Rails thing, we're not big fans of this. We're thinking about using locals instead, if possible.
Currently we have all these methods that only sets an instance variable:
Look into if it's possible to do something like:
Discussion regarding using locals: thoughtbot/guides#398, https://thepugautomatic.com/2013/05/locals/
The text was updated successfully, but these errors were encountered: