Last active
August 29, 2015 13:56
-
-
Save drogus/9156090 to your computer and use it in GitHub Desktop.
This file contains 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>My Little Webapp: Coding Is Magic</title> | |
<meta charset="UTF-8" /> | |
<link rel="stylesheet" href="https://rawgithub.com/krzysztofbialek/Rails-Girls-Warsaw-App/master/style.css" /> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains 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
<h1>My Rails Girls Diary</h1> | |
<div> | |
<h2>Submitted a Rails Girls application</h2> | |
<p>1.02.2014</p> | |
<p>Just submitted an application to a Rails Girls workshop. Can’t wait to see whether I’ll get in!</p> | |
<h2>Got in!</h2> | |
<p>15.02.2014</p> | |
<p>Received an email that my application got accepted! I’ll be at a RG workshop next week!</p> | |
<h2>The first day starts…</h2> | |
<p>22.02.2014</p> | |
<p>Today is the first day of the Rails Girls workshop. My coach is quite strange but it seems we all have Rails installed now and can start learning.</p> | |
</div> |
This file contains 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> | |
<h1>My favourite websites</h1> | |
<ul> | |
<li><a href="http://railsgirls.com">Rails Girls</a></li> | |
<li><a href="https://en.wikibooks.org/wiki/Ruby_Programming">Wikibooks</a></li> | |
<li><a href="http://guides.rubyonrails.org">Ruby on Rails Guides</a></li> | |
</ul> | |
</div> | |
<img src="http://railsgirls.com/images/rg-warsaw.png" /> |
This file contains 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
<% | |
@websites = [ | |
["http://railsgirls.com", "Rails Girls"], | |
["https://en.wikibooks.org/wiki/Ruby_Programming", "Wikibooks"], | |
["http://guides.rubyonrails.org", "Ruby on Rails Guides"], | |
] | |
%> | |
<% for url, name in @websites %> | |
<li><a href="<%= url %>"><%= name %></a></li> | |
<% end %> |
This file contains 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 WelcomeController < ApplicationController | |
def index | |
@websites = [ | |
["http://railsgirls.com", "Rails Girls"], | |
["https://en.wikibooks.org/wiki/Ruby_Programming", "Wikibooks"], | |
["http://guides.rubyonrails.org", "Ruby on Rails Guides"], | |
] | |
end | |
end |
This file contains 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
Entry.create "title" => "Submitted a Rails Girls application", "date" => Date.new(2014, 2, 1), "contents" => "Just submitted an application to a Rails Girls workshop. Can’t wait to see whether I’ll get in!" | |
Entry.create "title" => "Got in!", "date" => Date.new(2014, 2, 15), "contents" => "Received an email that my application got accepted! I’ll be at a RG workshop next week!" | |
Entry.create "title" => "The first day starts…", "date" => Date.new(2014, 2, 22), "contents" => "Today is the first day of the Rails Girls workshop. My coach is quite strange but it seems we all have Rails installed now and can start learning." |
This file contains 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
@entries = Entry.all |
This file contains 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
<% @entries.each do |entry| %> | |
<h2><%= entry.title %></h2> | |
<p><%= entry.date %></p> | |
<p><%= entry.contents %></p> | |
<% end %> |
This file contains 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
def index | |
end |
This file contains 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
def show | |
@entry = Entry.find(params["id"]) | |
end |
This file contains 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
<h2><%= @entry.title %></h2> | |
<p><%= @entry.date %></p> | |
<p><%= @entry.contents %></p> |
This file contains 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
<h2><%= link_to(entry.title, entry_path(entry)) %></h2> |
This file contains 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
<p><%= link_to("Back to all entries", entries_path) %></p> |
This file contains 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
<%= link_to("New entry", new_entry_path) %> |
This file contains 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
<%= form_for(Entry.new) do |form| %> | |
<p><%= form.label("title") %></p> | |
<p><%= form.text_field("title") %></p> | |
<p><%= form.label("contents") %></p> | |
<p><%= form.text_area("contents") %></p> | |
<p><%= form.submit %></p> | |
<% end %> | |
<p><%= link_to("Back to all entries", entries_path) %></p> |
This file contains 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
def create | |
render(:text => params.inspect) | |
end |
This file contains 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
def create | |
entry_params = params["entry"].permit("title", "contents") | |
entry = Entry.create(entry_params) | |
redirect_to(entries_path) | |
end |
This file contains 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
entry_params = params["entry"].permit("title", "contents") |
This file contains 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
def show | |
@entry = Entry.find(params["id"]) | |
end |
This file contains 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
<h2><%= @entry.title %></h2> | |
<p><%= @entry.date %></p> | |
<p><%= @entry.contents %></p> |
This file contains 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
<p><%= link_to("Edit this entry", edit_entry_path(@entry)) %></p> |
This file contains 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
def edit | |
@entry = Entry.find(params["id"]) | |
end |
This file contains 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
<%= form_for(@entry) do |form| %> | |
<p><%= form.label("title") %></p> | |
<p><%= form.text_field("title") %></p> | |
<p><%= form.label("content") %></p> | |
<p><%= form.text_area("content") %></p> | |
<p><%= form.submit %></p> | |
<% end %> | |
<p><%= link_to("Back to this entry", entry_path(@entry)) %></p> | |
<p><%= link_to("Back to all entries", entries_path) %></p> |
This file contains 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
def update | |
entry_params = params["entry"].permit("title", "content") | |
entry = Entry.find(params["id"]) | |
entry.update(entry_params) | |
redirect_to(entry_path(entry)) | |
end |
This file contains 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
<%= link_to("Delete", entry_path(@entry), "method" => "delete") %> |
This file contains 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
def destroy | |
@entry = Entry.find params['id'] | |
@entry.destroy | |
redirect_to entries_path | |
end |
Wygenerowanie "rusztowania":
rails g scaffold movie title:string year:integer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
26: