WeblogPcr ========= This is a basic weblog generator for rails. It's been tested on Rails 2.3.2 and higher. NOTE: Read assumptions prior to use. To use: ./script/generate weblog_pcr blogs [user] [current_user] \ --use-https -The first parameter specifies the name of the main controller (or model) that handles the blog entries. The model, controller, views, and migrations will be generated as well as for additional resources that handle comments, followers and the sidebar functionality. It's recommended to use modules to scope the generated classes (in either UpperCamelCase or under_score format). For example: ./script/generate weblog_pcr Physical::Blog::Entries (or Entry) Note: if Physical is your top-level directory it will be ignored when naming the database tables. For example the example above will create the tables blog_entries, blog_comments, blog_followers, blog_images. -The second parameter specifies the name of the user model used for authentication. It can contain modules as the first parameter. The user table will be inferred from the user model name. WeblogPcr assumes that you have an authentication system put in place (such RestfulAuthentication). The only assumptions for the authentication are that there is an authentication model, a @current_user instance variable (see next parameter), and a login_required filter that sets @current_user. The name of the model will be infered from the table name. The default is 'users'. -The third parameter specifies the name of an controller instance variable that returns the current user record or nil if no one is logged in. The default is current_user -The option --use-https will use the ssl_requirement plugin to require ssl for the blog management functionality. The generated routes will account for this too. Routes ====== Add the following line to your routes.rb map.from_plugin :weblog_pcr, "Physical::Blog::Entries", :use_https => true -The first parameter is the name of the plugin -The second parameter is the main controller (either UpperCamelCase or under_score) -The third parameter specifies whether to use https or not for the management routes (default is false) Make sure the second and third parameters are consistent with the parameters used for the generator. Assumptions =========== 1. There is an authenticaton system that defines an authentication model, a @current_user controller instance variable, and a login_required filter (see the description of the generator command line second parameter) 2. The following plugins have been installed: attachment_fu http://svn.techno-weenie.net/projects/plugins/attachment_fu/ ssl_requirement white_list http://svn.techno-weenie.net/projects/plugins/white_list/ responds_to http://responds-to-parent.googlecode.com/svn/trunk/ Copyright (c) 2009 [Pablo Calderon Rodriguez], released under the MIT license