Method: UtopiaData::Application#register
- Defined in:
- lib/utopia_data/application.rb
#register(resource_name, options = {}, &block) ⇒ Object
Register a resource
You can register a resource using the generetor resource, only run:
rails g utopia:resource lei
This command you be create a lei.rb path on app/resource with the content
UtopiaData.register :lei do
configs...
end
or
UtopiaData.regsiter :lei
After, you can enter on /leis.json for example and see your resource expose
55 56 57 |
# File 'lib/utopia_data/application.rb', line 55 def register(resource_name, = {}, &block) resource = find_or_create_resource(resource_name, , &block) end |