OSDN Git Service

add story
[pettanr/pettanr.git] / app / views / stories / show.html.erb
diff --git a/app/views/stories/show.html.erb b/app/views/stories/show.html.erb
new file mode 100644 (file)
index 0000000..dfa9eff
--- /dev/null
@@ -0,0 +1,25 @@
+<h1><%= h @comic.title %></h1>
+
+<% @stories.each do |story| %>
+  <% @story = story %>
+  <% @panel = story.panel %>
+  <%= render 'panels/standard' %>
+  <% if story.author.id == @author.id -%>
+    <span>
+    t:<%= story.t %>
+    </span>
+<%= button_to 'Destroy', @story, confirm: 'Are you sure?', method: :delete %>
+    <%= render 'editform' %>
+    <%= link_to 'open js', edit_story_path(story), :remote => true %>
+      <div id="story-update-<%= @story.id -%>">
+        t
+      </div>
+  <% end -%>
+<% end %>
+<% if @comic.author.id == @author.id -%>
+  <%= link_to 'add panel', new_story_path, :remote => true %>
+    <div id="story-create">
+      t
+    </div>
+<% end %>
+<%= link_to 'Back', comics_path %>