triannon 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c07f371ee48e9009a0939488713930cf86ceb374
|
4
|
+
data.tar.gz: 8c8fcd9dd0f6df80a1c254894cd34090a4f96bcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8a3a250a33f946a1c9704af4fcd554bacb7154fb804457de64df9d948a0210365c0072261bede0ac3c6904e732881a0a71811fdaaa05d3bede2f6144a497aa5
|
7
|
+
data.tar.gz: c86be08cdcab1acfc2a2ce32ffe6374ac0bac1813c715862f2d33c18d2e07b9400c84b311bfb22ca8e65701d3c5f1dd6f7360e323d4ba246c4bd1915f8f18e7e
|
@@ -42,8 +42,18 @@ module Triannon
|
|
42
42
|
|
43
43
|
# POST /annotations/annotations
|
44
44
|
def create
|
45
|
-
|
46
|
-
|
45
|
+
# FIXME: this is probably a bad way of allowing app form to be used as well as direct post requests
|
46
|
+
if params["annotation"]
|
47
|
+
# it's from app html form
|
48
|
+
params.require(:annotation).permit(:data)
|
49
|
+
if params["annotation"]["data"]
|
50
|
+
@annotation = Annotation.new({:data => params["annotation"]["data"]})
|
51
|
+
end
|
52
|
+
else
|
53
|
+
# it's a direct post request
|
54
|
+
@annotation = Annotation.new(:data => request.body.read)
|
55
|
+
end
|
56
|
+
|
47
57
|
if @annotation.save
|
48
58
|
redirect_to @annotation, notice: 'Annotation was successfully created.'
|
49
59
|
else
|
@@ -53,7 +63,7 @@ module Triannon
|
|
53
63
|
|
54
64
|
# PATCH/PUT /annotations/annotations/1
|
55
65
|
def update
|
56
|
-
if @annotation.update(
|
66
|
+
if @annotation.update(params)
|
57
67
|
redirect_to @annotation, notice: 'Annotation was successfully updated.'
|
58
68
|
else
|
59
69
|
render :edit
|
@@ -71,7 +81,7 @@ module Triannon
|
|
71
81
|
def set_annotation
|
72
82
|
@annotation = Annotation.find(params[:id])
|
73
83
|
end
|
74
|
-
|
84
|
+
|
75
85
|
def default_format_jsonld
|
76
86
|
if ((!request.accept || request.accept.empty?) && (!params[:format] || params[:format].empty?))
|
77
87
|
request.format = "jsonld"
|
data/lib/triannon/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: triannon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-11-
|
12
|
+
date: 2014-11-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|