Skip to content

Commit

Permalink
Merge pull request #5 from human-nyc/3/task/add-subtitle-field-to-bac…
Browse files Browse the repository at this point in the history
…kend

Add subtitle field to backend
  • Loading branch information
aaronzdavis committed Mar 14, 2016
2 parents f679a84 + afc8514 commit 8e29a04
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
18 changes: 13 additions & 5 deletions app/views/spree/admin/blog_entries/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@
<div class="row">
<div class="col-md-12">
<%= form.field_container :title do %>
<div class="form-group">
<%= form.label :title, Spree.t(:title) %> <span class="text-danger">*</span><br />
<%= form.text_field :title, :class => 'form-control' %>
<%= form.error_message_on :title %>
</div><!-- form-group -->
<div class="form-group">
<%= form.label :title, Spree.t(:title) %> <span class="text-danger">*</span><br />
<%= form.text_field :title, :class => 'form-control' %>
<%= form.error_message_on :title %>
</div>
<% end %>

<%= form.field_container :subtitle do %>
<div class="form-group">
<%= form.label :subtitle, Spree.t(:subtitle) %> <span class="text-danger">*</span><br />
<%= form.text_field :subtitle, :class => 'form-control' %>
<%= form.error_message_on :subtitle %>
</div>
<% end %>

<%= form.field_container :permalink do %>
Expand Down
1 change: 1 addition & 0 deletions app/views/spree/blog_entries/show.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ end

json.set! :blog_entry do
json.title @blog_entry.title
json.title @blog_entry.subtitle
json.body @blog_entry.body
json.permalink @blog_entry.permalink
json.created_at @blog_entry.created_at
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ en:
permalink: Permalink
published_at: Published at
visible: Visible
subtitle: subtitle
author_id: Author
tag_list: Tags
category_list: Categories
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20160314132600_add_subtitle_to_blog_entries.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddSubtitleToBlogEntries < ActiveRecord::Migration
def change
add_column :spree_blog_entries, :subtitle, :string
end
end

0 comments on commit 8e29a04

Please sign in to comment.