Skip to content

Commit

Permalink
added some documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Zachary Scott <[email protected]>
  • Loading branch information
burningTyger authored and Zachary Scott committed Mar 29, 2011
1 parent c6de979 commit 4982379
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 7 additions & 1 deletion helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,20 @@ def require_login!(opts = {:return => "/"})
redirect opts[:return]
end
end


# Many pages on rstatus are paginated. To keep track of it in all the
# different routes we have this handy helper that either picks up
# the previous setting or resets it to a default value.
def set_params_page
params[:page] ||= 1
params[:per_page] ||= 25
params[:page] = params[:page].to_i
params[:per_page] = params[:per_page].to_i
end

# Similar to the set_params_page helper this one creates the links
# for the previous and the next page on all routes that display
# stuff on more than one page.
def set_next_prev_page
@next_page = "?#{Rack::Utils.build_query :page => params[:page] + 1}"

Expand Down
8 changes: 8 additions & 0 deletions rstatus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@
# and then visit [http://localhost:9292/](http://localhost:9292). You're good
# to go!
#
# If you want to contribute to rstatus you will have to run the tests before you
# send a pull request. You can do so by calling
#
# $ rake test
#
# in the rstat.us root directory. Once your changes pass all tests you may commit
# and send a pull request via Github.
#
# [rvm]: http://rvm.beginrescueend.com/

#### About rstatus.rb
Expand Down

0 comments on commit 4982379

Please sign in to comment.