Skip to content

Commit

Permalink
Fixing the navigation and removing references to sample app
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris committed Jan 20, 2011
1 parent 5a85939 commit c302aeb
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 15 deletions.
6 changes: 4 additions & 2 deletions app/controllers/microposts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ class MicropostsController < ApplicationController

def create
success_message = "Micropost created!"
@micropost = current_user.microposts.build(params[:micropost])
puts params[:micropost]


if Blog.is_blog_post? params[:micropost][:content]
current_user.blogs.create_with_post params[:micropost][:content]
Expand All @@ -15,6 +14,9 @@ def create
new_show.save
success_message = "Show created!"
end

params[:micropost][:content] = params[:micropost][:content][0..136] + '...'
@micropost = current_user.microposts.build(params[:micropost])

if @micropost.save
redirect_to home_path, :flash => { :success => success_message}
Expand Down
5 changes: 3 additions & 2 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@ def followers
end

def new
redirect_to root_path unless signed_in?
@user = User.new
@title = "Sign up"
end

def create
@user = User.new(params[:user])
if @user.save
sign_in @user
#sign_in @user
@user.follow_all
redirect_to @user, :flash => { :success => "Welcome to the Sample App!" }
redirect_to users_path, :flash => { :success => "#{@user.name} created" }
else
@title = "Sign up"
render 'new'
Expand Down
4 changes: 0 additions & 4 deletions app/views/layouts/_footer.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<footer>
<nav class="round">
<ul>
<li><%= link_to "About", about_path %></li>
<li><%= link_to "Contact", contact_path %></li>
<li><%= link_to "News", 'http://news.railstutorial.org/' %></li>
<li><%= link_to "Rails Tutorial", 'http://railstutorial.org/' %></li>
</ul>
</nav>
</footer>
4 changes: 2 additions & 2 deletions app/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<li><%= link_to "Profile", current_user %></li>
<li><%= link_to "Users", users_path %></li>
<li><%= link_to "Settings", edit_user_path(current_user) %></li>
<% end %>
<li><%= link_to "Help", help_path %></li>
<li><%= link_to "Add User", signup_path %></li>
<% end %>
<% if signed_in? %>
<li><%= link_to "Sign out", signout_path %></li>
<% else %>
Expand Down
5 changes: 2 additions & 3 deletions app/views/pages/home.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@

<% else %>

<h1>Sample App</h1>
<p>
This is the home page for the <a href="http://railstutorial.org/">Ruby on Rails Tutorial</a> sample application.
This is the admin section for Geronimo!
</p>

<%= link_to "Sign up now!", signup_path, :class => "signup_button round" %>
<%= link_to "Sign in now!", signin_path, :class => "signup_button round" %>

<% end %>
8 changes: 8 additions & 0 deletions app/views/shared/_user_info.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,12 @@
<%= pluralize(current_user.microposts.count, "micropost") %>
</span>
</a>
<strong>Instructions</strong>
<div>
<p>To create a show type: show -text that describes show-</p>
<p>Use a date format you are comfortable with and the show will be placed in the correct order</p>
<p>To create a blog: blog -blog text-</p>
<p>To place the blog on the frontpage: blog frontpage -blog text-</p>
<p>For either a show or a blog, you can use the markdown language to add formatting (bold text, links, etc.). The syntax for markdown can be found <a href="http://daringfireball.net/projects/markdown/syntax">here</a></p>
</div>
</div>
4 changes: 2 additions & 2 deletions app/views/users/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<strong>URL</strong> <%= link_to user_path(@user), @user %><br />
<strong>Microposts</strong> <%= @user.microposts.count %>
<%= render 'shared/stats' %>

</td>
</tr>
</table>

</table>

0 comments on commit c302aeb

Please sign in to comment.