Class: MicropostsController
Instance Method Summary
collapse
#preferences_customer_type=, #preferences_customer_type?, #signed_in?, #signed_in_user, #store_location
Instance Method Details
#create ⇒ Object
8
9
10
11
12
13
14
15
16
17
|
# File 'app/controllers/microposts_controller.rb', line 8
def create
@micropost = current_user.microposts.build(params[:micropost])
if @micropost.save
flash[:success] = "Micropost created!"
redirect_to root_path
else
@feed_items = []
render 'static_pages/home'
end
end
|
#destroy ⇒ Object
19
20
21
22
|
# File 'app/controllers/microposts_controller.rb', line 19
def destroy
@micropost.destroy
redirect_to root_path
end
|
#index ⇒ Object
5
6
|
# File 'app/controllers/microposts_controller.rb', line 5
def index
end
|