Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 173
- Log:
Updated to latest release of Beast according to the "getting started with
Beast" guide at:http://beast.caboo.se/forums/1/topics/381
This check-in includes frozen Edge Rails and has the beginnings of
configuration for the ROOL site included.
- Author:
- rool
- Date:
- Fri Mar 02 15:59:12 +0000 2007
- Size:
- 1649 Bytes
1 | class ForumsController < ApplicationController |
2 | before_filter :login_required, :only => [:new, :create, :edit, :update, :destroy] |
3 | before_filter :find_or_initialize_forum, :except => :index |
4 | |
5 | def index |
6 | @forums = Forum.find(:all, :order => "position") |
7 | respond_to do |format| |
8 | format.html |
9 | format.xml { render :xml => @forums.to_xml } |
10 | end |
11 | end |
12 | |
13 | def show |
14 | respond_to do |format| |
15 | format.html do |
16 | # keep track of when we last viewed this forum for activity indicators |
17 | (session[:forums] ||= {})[@forum.id] = Time.now.utc if logged_in? |
18 | @topic_pages, @topics = paginate(:topics, :per_page => 25, :conditions => ['forum_id = ?', params[:id]], :include => :replied_by_user, :order => 'sticky desc, replied_at desc') |
19 | end |
20 | |
21 | format.xml do |
22 | render :xml => @forum.to_xml |
23 | end |
24 | end |
25 | end |
26 | |
27 | # new renders new.rhtml |
28 | |
29 | def create |
30 | @forum.attributes = params[:forum] |
31 | @forum.save! |
32 | respond_to do |format| |
33 | format.html { redirect_to forums_path } |
34 | format.xml { head :created, :location => formatted_forum_url(:id => @forum, :format => :xml) } |
35 | end |
36 | end |
37 | |
38 | def update |
39 | @forum.attributes = params[:forum] |
40 | @forum.save! |
41 | respond_to do |format| |
42 | format.html { redirect_to forums_path } |
43 | format.xml { head 200 } |
44 | end |
45 | end |
46 | |
47 | def destroy |
48 | @forum.destroy |
49 | respond_to do |format| |
50 | format.html { redirect_to forums_path } |
51 | format.xml { head 200 } |
52 | end |
53 | end |
54 | |
55 | protected |
56 | def find_or_initialize_forum |
57 | @forum = params[:id] ? Forum.find(params[:id]) : Forum.new |
58 | end |
59 | |
60 | alias authorized? admin? |
61 | end |