I'm making method that can used in Rspec test and Controllers. But i don't know where to store it.
Here are options that i have thought.
-
application_helper -> but this file is used for method which used in applicaion controller.
-
spec_helper.rb
-
rails_helper.rb -> these two file is for rspec test
where should i store it?
I read this article but i'm not using models.
How to make a custom method that can be used anywhere in rails app
Now i had stored it at application_helper.rb, and call as
ApplicationController.helpers.custom_method
Is this right practice?
Aucun commentaire:
Enregistrer un commentaire