-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 72dd07e
Showing
167 changed files
with
11,371 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
== Welcome to my newbie Blog System in Rails, this is a project for my university monography. | ||
I'm a newbie in Rails, Object-Oriented Programming and also Web-Programming, I work as a COBOL Mainframe programmer, completely different area. | ||
I just started in this new PC/WEB area, and I'm sure that's the future, I hope get some help here. | ||
|
||
================================================================================================================ | ||
|
||
Basically my idea is something like this (consider as a textual class diagram please): | ||
=> User login:string name:string email:string crypted_password:string salt:string image:binary created_at:datetime updated_at:datetime remember_token:string remember_token_expires_at:datetime | ||
-Want use Restful_Authentication plugin here, also upload a picture for the user | ||
|
||
=> Blog name:string address:string description:text icon:binary template_id:references | ||
-Icon to be used as Favicon in the blog, also use some CSS already build like Zen Garden's CSS | ||
|
||
=> BlogUser blog_id:references user_id:references level:integer | ||
-Level for the user (Integer 1 byte): | ||
9 - System Owner | ||
8 - Power Admin | ||
7 - Admin | ||
6 - Moderator ( 9 to 6 will user blog_id = 0 because they have to control every blog and every user, maybe to avoid forbidden stuff like pornography or piracy or spam) | ||
5 - reserved for the future | ||
4 - Blog Owner | ||
3 - Blog Post Member | ||
2 - Banished from Blog (maybe for spammers) | ||
1 - Banished from system (also using blog_id = 0) | ||
-Users without level can only comment, only logged users could comment | ||
|
||
=> Template name:string css:string | ||
-Built CSS just for the blogs | ||
|
||
=> Post blog_id:references user_id:references title:string body:text | ||
|
||
=> Category name:string | ||
|
||
=> CategoryPost category_id:references post_id:references | ||
|
||
=> Comment post_id:references user_id:references body:text | ||
|
||
================================================================================================================ | ||
|
||
Well that's the idea, I hope you help me 8D | ||
I don't know why, but I can't commit the restful_authentication plugin into my repository. | ||
|
||
Using the gems: | ||
-RMagick | ||
-will_paginate | ||
until now | ||
|
||
Using the plugins: | ||
-restful_authentication | ||
until now too | ||
|
||
Luiz Biagi | ||
Rails Beginner | ||
luizbiagi (at) gmail (dot) com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Add your own tasks in files placed in lib/tasks ending in .rake, | ||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | ||
|
||
require(File.join(File.dirname(__FILE__), 'config', 'boot')) | ||
|
||
require 'rake' | ||
require 'rake/testtask' | ||
require 'rake/rdoctask' | ||
|
||
require 'tasks/rails' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Filters added to this controller apply to all controllers in the application. | ||
# Likewise, all the methods added will be available for all controllers. | ||
|
||
class ApplicationController < ActionController::Base | ||
helper :all # include all helpers, all the time | ||
include AuthenticatedSystem | ||
# See ActionController::RequestForgeryProtection for details | ||
# Uncomment the :secret if you're not using the cookie session store | ||
protect_from_forgery # :secret => 'ddbb872d118c4996f0eb80d44dc08068' | ||
|
||
# See ActionController::Base for details | ||
# Uncomment this to filter the contents of submitted sensitive data parameters | ||
# from your application log (in this case, all fields with names like "password"). | ||
# filter_parameter_logging :password | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
class BlogUsersController < ApplicationController | ||
# GET /blog_users | ||
# GET /blog_users.xml | ||
def index | ||
@blog_users = BlogUser.find(:all) | ||
|
||
respond_to do |format| | ||
format.html # index.html.erb | ||
format.xml { render :xml => @blog_users } | ||
end | ||
end | ||
|
||
# GET /blog_users/1 | ||
# GET /blog_users/1.xml | ||
def show | ||
@blog_user = BlogUser.find(params[:id]) | ||
|
||
respond_to do |format| | ||
format.html # show.html.erb | ||
format.xml { render :xml => @blog_user } | ||
end | ||
end | ||
|
||
# GET /blog_users/new | ||
# GET /blog_users/new.xml | ||
def new | ||
@blog_user = BlogUser.new | ||
|
||
respond_to do |format| | ||
format.html # new.html.erb | ||
format.xml { render :xml => @blog_user } | ||
end | ||
end | ||
|
||
# GET /blog_users/1/edit | ||
def edit | ||
@blog_user = BlogUser.find(params[:id]) | ||
end | ||
|
||
# POST /blog_users | ||
# POST /blog_users.xml | ||
def create | ||
@blog_user = BlogUser.new(params[:blog_user]) | ||
|
||
respond_to do |format| | ||
if @blog_user.save | ||
flash[:notice] = 'BlogUser was successfully created.' | ||
format.html { redirect_to(@blog_user) } | ||
format.xml { render :xml => @blog_user, :status => :created, :location => @blog_user } | ||
else | ||
format.html { render :action => "new" } | ||
format.xml { render :xml => @blog_user.errors, :status => :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# PUT /blog_users/1 | ||
# PUT /blog_users/1.xml | ||
def update | ||
@blog_user = BlogUser.find(params[:id]) | ||
|
||
respond_to do |format| | ||
if @blog_user.update_attributes(params[:blog_user]) | ||
flash[:notice] = 'BlogUser was successfully updated.' | ||
format.html { redirect_to(@blog_user) } | ||
format.xml { head :ok } | ||
else | ||
format.html { render :action => "edit" } | ||
format.xml { render :xml => @blog_user.errors, :status => :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# DELETE /blog_users/1 | ||
# DELETE /blog_users/1.xml | ||
def destroy | ||
@blog_user = BlogUser.find(params[:id]) | ||
@blog_user.destroy | ||
|
||
respond_to do |format| | ||
format.html { redirect_to(blog_users_url) } | ||
format.xml { head :ok } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
class BlogsController < ApplicationController | ||
# GET /blogs | ||
# GET /blogs.xml | ||
def index | ||
@blogs = Blog.find(:all) | ||
|
||
respond_to do |format| | ||
format.html # index.html.erb | ||
format.xml { render :xml => @blogs } | ||
end | ||
end | ||
|
||
# GET /blogs/1 | ||
# GET /blogs/1.xml | ||
def show | ||
@blog = Blog.find(params[:id]) | ||
|
||
respond_to do |format| | ||
format.html # show.html.erb | ||
format.xml { render :xml => @blog } | ||
end | ||
end | ||
|
||
# GET /blogs/new | ||
# GET /blogs/new.xml | ||
def new | ||
@blog = Blog.new | ||
|
||
respond_to do |format| | ||
format.html # new.html.erb | ||
format.xml { render :xml => @blog } | ||
end | ||
end | ||
|
||
# GET /blogs/1/edit | ||
def edit | ||
@blog = Blog.find(params[:id]) | ||
end | ||
|
||
# POST /blogs | ||
# POST /blogs.xml | ||
def create | ||
@blog = Blog.new(params[:blog]) | ||
|
||
respond_to do |format| | ||
if @blog.save | ||
flash[:notice] = 'Blog was successfully created.' | ||
format.html { redirect_to(@blog) } | ||
format.xml { render :xml => @blog, :status => :created, :location => @blog } | ||
else | ||
format.html { render :action => "new" } | ||
format.xml { render :xml => @blog.errors, :status => :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# PUT /blogs/1 | ||
# PUT /blogs/1.xml | ||
def update | ||
@blog = Blog.find(params[:id]) | ||
|
||
respond_to do |format| | ||
if @blog.update_attributes(params[:blog]) | ||
flash[:notice] = 'Blog was successfully updated.' | ||
format.html { redirect_to(@blog) } | ||
format.xml { head :ok } | ||
else | ||
format.html { render :action => "edit" } | ||
format.xml { render :xml => @blog.errors, :status => :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# DELETE /blogs/1 | ||
# DELETE /blogs/1.xml | ||
def destroy | ||
@blog = Blog.find(params[:id]) | ||
@blog.destroy | ||
|
||
respond_to do |format| | ||
format.html { redirect_to(blogs_url) } | ||
format.xml { head :ok } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
class CategoriesController < ApplicationController | ||
# GET /categories | ||
# GET /categories.xml | ||
def index | ||
@categories = Category.find(:all) | ||
|
||
respond_to do |format| | ||
format.html # index.html.erb | ||
format.xml { render :xml => @categories } | ||
end | ||
end | ||
|
||
# GET /categories/1 | ||
# GET /categories/1.xml | ||
def show | ||
@category = Category.find(params[:id]) | ||
|
||
respond_to do |format| | ||
format.html # show.html.erb | ||
format.xml { render :xml => @category } | ||
end | ||
end | ||
|
||
# GET /categories/new | ||
# GET /categories/new.xml | ||
def new | ||
@category = Category.new | ||
|
||
respond_to do |format| | ||
format.html # new.html.erb | ||
format.xml { render :xml => @category } | ||
end | ||
end | ||
|
||
# GET /categories/1/edit | ||
def edit | ||
@category = Category.find(params[:id]) | ||
end | ||
|
||
# POST /categories | ||
# POST /categories.xml | ||
def create | ||
@category = Category.new(params[:category]) | ||
|
||
respond_to do |format| | ||
if @category.save | ||
flash[:notice] = 'Category was successfully created.' | ||
format.html { redirect_to(@category) } | ||
format.xml { render :xml => @category, :status => :created, :location => @category } | ||
else | ||
format.html { render :action => "new" } | ||
format.xml { render :xml => @category.errors, :status => :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# PUT /categories/1 | ||
# PUT /categories/1.xml | ||
def update | ||
@category = Category.find(params[:id]) | ||
|
||
respond_to do |format| | ||
if @category.update_attributes(params[:category]) | ||
flash[:notice] = 'Category was successfully updated.' | ||
format.html { redirect_to(@category) } | ||
format.xml { head :ok } | ||
else | ||
format.html { render :action => "edit" } | ||
format.xml { render :xml => @category.errors, :status => :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# DELETE /categories/1 | ||
# DELETE /categories/1.xml | ||
def destroy | ||
@category = Category.find(params[:id]) | ||
@category.destroy | ||
|
||
respond_to do |format| | ||
format.html { redirect_to(categories_url) } | ||
format.xml { head :ok } | ||
end | ||
end | ||
end |
Oops, something went wrong.