From 03abd1ac21cb782d106d79ad00b6ac3e0596e630 Mon Sep 17 00:00:00 2001 From: Raphael <raphael@joindiaspora.com> Date: Tue, 24 Aug 2010 14:44:32 -0700 Subject: [PATCH] Remove statuS MESsages new page. TaKE New OUt OF ROutes --- app/controllers/status_messages_controller.rb | 7 +------ app/views/status_messages/new.html.haml | 13 ------------- config/routes.rb | 2 +- 3 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 app/views/status_messages/new.html.haml diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 1fc0ac9d1c..d5cd07d51c 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -6,17 +6,12 @@ class StatusMessagesController < ApplicationController @status_message = current_user.post(:status_message, params[:status_message]) if @status_message.created_at - flash[:notice] = "Successfully created status message." render :nothing => true else - render :action => 'new' + redirect_to root_url end end - def new - @status_message = StatusMessage.new - end - def destroy @status_message = StatusMessage.where(:id => params[:id]).first @status_message.destroy diff --git a/app/views/status_messages/new.html.haml b/app/views/status_messages/new.html.haml deleted file mode 100644 index 2e9c884749..0000000000 --- a/app/views/status_messages/new.html.haml +++ /dev/null @@ -1,13 +0,0 @@ -- title "New Status Message" - -= form_for @status_message, :remote => true do |f| - = f.error_messages - %p - = f.label :message - %br - = f.text_field :message - %p - = f.submit - - -%p= link_to "Back to List", status_messages_path diff --git a/config/routes.rb b/config/routes.rb index f2b4ebd801..1f3efbbbd9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,7 +1,7 @@ Diaspora::Application.routes.draw do resources :people, :only => [:index, :show, :destroy] resources :users, :except => [:create, :new] - resources :status_messages, :except => [:index] + resources :status_messages, :only => [:create, :destroy, :show] resources :comments, :except => [:index] resources :requests, :except => [:edit, :update] resources :photos, :except => [:index] -- GitLab