Module: Databound
- Defined in:
- lib/databound.rb,
lib/databound/data.rb,
lib/databound/config.rb,
lib/databound/manager.rb,
lib/databound/railtie.rb,
lib/databound/version.rb,
lib/databound/controller.rb,
lib/databound/initializer.rb,
lib/generators/databound/install/install_generator.rb
Defined Under Namespace
Modules: Generators, Initializer
Classes: Config, Controller, Data, Manager, NotPermittedError, Railtie
Constant Summary
collapse
- VERSION =
'3.0.3'
Instance Method Summary
collapse
Instance Method Details
#create ⇒ Object
17
18
19
20
21
22
23
24
25
|
# File 'lib/databound.rb', line 17
def create
record = @crud.create_from_data
render json: {
success: true,
id: serialize(record, :id),
scoped_records: serialize_array(scoped_records),
}
end
|
#destroy ⇒ Object
37
38
39
40
41
42
43
44
|
# File 'lib/databound.rb', line 37
def destroy
@crud.destroy_from_data
render json: {
success: true,
scoped_records: serialize_array(scoped_records),
}
end
|
#update ⇒ Object
27
28
29
30
31
32
33
34
35
|
# File 'lib/databound.rb', line 27
def update
record = @crud.update_from_data
render json: {
success: true,
id: serialize(record, :id),
scoped_records: serialize_array(scoped_records),
}
end
|
#where ⇒ Object
12
13
14
15
|
# File 'lib/databound.rb', line 12
def where
records = @crud.find_scoped_records
render json: serialize_array(records)
end
|