Już niedługo nowy layout i kilka niespodzianek...
Podświetlanie składni: Zawijaj linie.
Nick: brak Data dodania: 04.02.12 23:05:01 Adres IP: 195.150.57.*
  1. class CardsController < ApplicationController
  2.   before_filter :authenticate_user!
  3.   def index
  4.     @cards = Card.order("created_at DESC")
  5.   end
  6.  
  7.   def show
  8.     @card = Card.first
  9.   end
  10.  
  11.   def new
  12.     @card = Card.new
  13.   end
  14.  
  15.   def create
  16.     @card = Card.new(params[:card])
  17.     if @card.save
  18.       flash[:notice] = "Thanks for adding the card"
  19.       redirect_to :action => "index"
  20.     else
  21.       render :action => "new"
  22.     end
  23.   end
  24.  
  25.   def edit
  26.   end
  27.  
  28.   def delete
  29.   end
  30.  
  31. end
  32.