Skip to content

Commit

Permalink
Steps edit form responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
RonaldoMoraes committed Jun 10, 2016
1 parent 433fddd commit 9a180ce
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
17 changes: 9 additions & 8 deletions Mooc/app/views/steps/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<%= form_for(@step) do |f| %>

<div class="field">
<div class="form-group">
<%= f.label :name %><br>
<%= f.text_field :name %>
<%= f.text_field :name, class: "form-control" %>
</div>
<div class="field">
<div class="form-group">
<%= f.label :body %><br>
<%= f.text_area :body %>
<%= f.text_area :body, class: "form-control" %>
</div>
<div class="field">
<div class="form-group">
<%= f.label :pdf_url %><br>
<%= f.text_field :pdf_url %>
<%= f.text_field :pdf_url, class: "form-control" %>
</div>
<div class="actions">
<%= f.submit %>

<div class="form-group">
<%= f.submit "Submit", class: "btn btn-primary btn-lg" %>
</div>
<% end %>
12 changes: 8 additions & 4 deletions Mooc/app/views/steps/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<h1>Editing Step</h1>

<%= render 'form' %>
<div style="margin: 0 auto; width: 50%; ">
<div style="text-align: center;">
<h1>Editing Step</h1>
<%= render 'form' %>
</div>
</div>

<%= link_to 'Show', @step %> |
<%= link_to 'Back', steps_path %>
<%#= link_to 'Show', @step %>
<%#= link_to 'Back', steps_path %>
9 changes: 7 additions & 2 deletions Mooc/app/views/tutorials/show/_show_step.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
<%= step.body %><br><br>
<% end %>

<% if @step.pdf_url != '' %>
<p><b>Material em PDF: </b></p><br>
<% if @step.pdf_url || @step.pdf_url != '' %>
<p>
<b>Material em PDF: </b>
<a href="<%= step.pdf_url %>"><%= step.pdf_url %></a>
</p>
<br>
<% end %>


<% if @step.video_url != '' %>
<div class="thumbnail">
<div class="embed-responsive embed-responsive-16by9">
Expand Down
6 changes: 3 additions & 3 deletions Mooc/db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
User.create!(email: "[email protected]", password: "admin123", name: "Ronaldo")

Category.create!(name: "Game")
Category.create!(name: "Ruby Language")
Category.create!(name: "PHP Language")
Category.create!(name: "Ruby on Rails Framework")
Category.create!(name: "Ruby")
Category.create!(name: "PHP")
Category.create!(name: "Ruby on Rails")

0 comments on commit 9a180ce

Please sign in to comment.