This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if @quote.errors.any? %> | |
<div class="alert alert-error"> | |
<% @quote.errors.full_messages.each do |msg| %> | |
<p><%= msg %></p> | |
<% end %> | |
</div> | |
<% end %> | |
<%= form_for @quote do |f| %> | |
<%= f.label :content %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="hero-unit"> | |
<% if @quote %> | |
<blockquote> | |
<p><%= @quote.content %></p> | |
<small><%= @quote.author %></small> | |
</blockquote> | |
<%= link_to 'Excluir frase', quote_path(@quote), method: :delete, confirm: 'Tem certeza?', class: 'btn' %> | |
<% else %> | |
<p>Nenhuma frase cadastrada.</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class QuotesController < ApplicationController | |
def home | |
@quote = Quote.all.sort_by{rand}.slice(0,10).first | |
respond_to :html | |
end | |
def show | |
@quote = Quote.find params[:id] | |
respond_to :html | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="hero-unit"> | |
<% if @quote %> | |
<blockquote> | |
<p><%= @quote.content %></p> | |
<small><%= @quote.author %></small> | |
</blockquote> | |
<% else %> | |
<p>Nenhuma frase cadastrada.</p> | |
<%= link_to 'Cadastre uma frase' %> | |
<% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="alert alert-error"> | |
<% @quote.errors.full_messages.each do |msg| %> | |
<p><%= msg %></p> | |
<% end %> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class QuotesController < ApplicationController | |
def home | |
respond_to :html | |
end | |
def new | |
@quote = Quote.new | |
respond_to :html | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="hero-unit"> | |
<blockquote> | |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> | |
<small>Someone famous <cite title="Source Title">Source Title</cite></small> | |
</blockquote> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Quotes</title> | |
<%= stylesheet_link_tag "application", :media => "all" %> | |
<%= javascript_include_tag "application" %> | |
<%= csrf_meta_tags %> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#outline { | |
width:800px; | |
margin:0 auto; | |
border:1px solid #ddd; | |
} | |
#logo { | |
display:inline-block; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="top"> | |
<div id="logo"> | |
</div> | |
<div id="section"> | |
</div> | |
</div> |