· 1 min read
Screencast: Controller in Rails 3
Download:
Download(20.3 MB, 10:49) Alternativer Download für iPod & Apple TV(18.5 MB, 10:49)
Resourcen:
Quellcode:
[ruby] # config/application.rb config.filter_parameters += [:password]
# products_controller redirect_to @product, :notice => “Successfully created product.” redirect_to [:edit, @product] redirect_to [@category, :edit, @product]
cookies.permanent[:last_product_id] = @product.id
# in class respond_to :html, :xml
# in action respond_with(@products) respond_with(@product, :location => products_url) respond_with(@product, :responder => MyResponder) respond_with(@product) do |format| format.xml { render :text => “I’m XML!” } end [/ruby]