Skip to content

Commit

Permalink
Fleshed out the pages concept a bit more with yaml database import
Browse files Browse the repository at this point in the history
  • Loading branch information
augustf committed Aug 2, 2014
1 parent d7aa50c commit ba464e6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 0 additions & 3 deletions app/views/pages/index.html.erb
Expand Up @@ -9,7 +9,6 @@
<th>Body</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>

Expand All @@ -19,11 +18,9 @@
<td><%= page.category %></td>
<td><%= page.language%></td>
<td><%= page.title %></td>
<td><%= page.summary %></td>
<td><%= page.body %></td>
<td><%= link_to 'Show', page %></td>
<td><%= link_to 'Edit', edit_page_path(page) %></td>
<td><%= link_to 'Destroy', page, method: :delete, data => { confirm => 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
Expand Down
4 changes: 4 additions & 0 deletions db/seed_assets/pages.yml
@@ -0,0 +1,4 @@
pages:
- title: "Concerto Init.d Startup Script"
category: Setup
body: "The concerto-init.d script should be installed to /etc/init.d/concerto"
5 changes: 5 additions & 0 deletions db/seeds.rb
Expand Up @@ -147,3 +147,8 @@
Field.where('name NOT IN (?)', ['Dynamic', 'Time']).each do |f|
Subscription.where(:feed_id => feed_id, :field_id => f.id, :screen_id => screen_id).first_or_create(:weight => 1)
end

#Page import
seed_file = File.join(Rails.root, 'db', 'seed_assets' ,'pages.yml')
seeds = YAML::load_file(seed_file)
Page.create(seeds["pages"])

0 comments on commit ba464e6

Please sign in to comment.