Skip to content
This repository has been archived by the owner on Apr 14, 2018. It is now read-only.

Commit

Permalink
begin work on helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
phallstrom committed Apr 9, 2009
1 parent 9edc95f commit 434f919
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/controllers/helper_controller.rb
@@ -0,0 +1,7 @@
class HelperController < ApplicationController

def helper
@helper = params[:id]
end

end
2 changes: 2 additions & 0 deletions app/helpers/helper_helper.rb
@@ -0,0 +1,2 @@
module HelperHelper
end
3 changes: 3 additions & 0 deletions app/views/helper/_fb_name.html.erb
@@ -0,0 +1,3 @@
<% content_for :helper_description do %>
Renders the name of the user specified, optionally linked to his or her profile.
<% end %>
9 changes: 9 additions & 0 deletions app/views/helper/helper.html.erb
@@ -0,0 +1,9 @@
<div id="header">
<h1>Helper: <%= @helper %></h1>
<%= yield :helper_description %>
</div>

<div id='helper'>
<%= render :partial => @helper %>
</div>

8 changes: 8 additions & 0 deletions app/views/shared/_sidebar.html.erb
@@ -1,5 +1,13 @@
<ul id="sidebar-items">

<li>
<h3>Helper Methods</h3>
<ul class="links">
<li><%= link_to 'fb_name', helper_path('fb_name') %></li>
<li><%= link_to 'fb_profile_pic', '' %></li>
</ul>
</li>

<li>
<h3>Facebooker Links</h3>
<ul class="links">
Expand Down
2 changes: 2 additions & 0 deletions config/routes.rb
Expand Up @@ -3,6 +3,8 @@

map.root :controller => "home"

map.helper '/helpers/:id', :controller => 'helper', :action => 'helper'

map.with_options :controller => 'connect' do |r|
r.logout '/connect/logout', :action => 'logout'
r.login '/connect/login', :action => 'login'
Expand Down
2 changes: 1 addition & 1 deletion public/stylesheets/application.css
Expand Up @@ -101,7 +101,7 @@ a {
}


#getting-started {
#getting-started, #helper {
border-top: 1px solid #ccc;
margin-top: 25px;
padding-top: 15px;
Expand Down
8 changes: 8 additions & 0 deletions test/functional/helper_controller_test.rb
@@ -0,0 +1,8 @@
require 'test_helper'

class HelperControllerTest < ActionController::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end
4 changes: 4 additions & 0 deletions test/unit/helpers/helper_helper_test.rb
@@ -0,0 +1,4 @@
require 'test_helper'

class HelperHelperTest < ActionView::TestCase
end

0 comments on commit 434f919

Please sign in to comment.