### Home Classes Methods

### In Files

- app/controllers/line_items_controller.rb

### Parent

ApplicationController

### Methods

- #create
- #destroy
- #edit
- #index
- #new
- #show
- #update

### Files

- README_FOR_APP

### Class Index

Quicksearch

- AdminController
- AdminHelper
- ApplicationController
- ApplicationHelper
- Cart
- CartsController
- CartsHelper
- LineItem
- LineItemsController
- LineItemsHelper
- Notifier
- Order
- OrdersController
- OrdersHelper
- Product
- ProductsController
- ProductsHelper
- SessionsController
- SessionsHelper
- StoreController
- StoreHelper
- User
- UsersController
- UsersHelper

No matching classes.

# LineItemsController

### Public Instance Methods

create() click to toggle source

POST /line_items POST /line_items.xml

        # File app/controllers/line_items_controller.rb, line 44
    44:   def create

    45:     @cart = current_cart

    46:     product = Product.find(params[:product_id])

    47:     @line_item = @cart.add_product(product.id)

    48:

    49:     respond_to do |format|

    50:       if @line_item.save

    51:         format.html { redirect_to(store_url) }

    52:         format.js { @current_item = @line_item }

    53:         format.xml  { render :xml => @line_item, :status => :created, :location => @line_item }

    54:       else

    55:         format.html { render :action => "new" }

    56:         format.xml  { render :xml => @line_item.errors, :status => :unprocessable_entity }

    57:       end

    58:     end

    59:   end

destroy() click to toggle source

DELETE /line_items/1 DELETE /line_items/1.xml

        # File app/controllers/line_items_controller.rb, line 79
    79:   def destroy

    80:     @line_item = LineItem.find(params[:id])

    81:     @line_item.destroy

    82:

    83:     respond_to do |format|

    84:       format.html { redirect_to(line_items_url) }

    85:       format.xml  { head :ok }

    86:     end

    87:   end

edit() click to toggle source

GET /line_items/1/edit

        # File app/controllers/line_items_controller.rb, line 38
    38:   def edit

    39:     @line_item = LineItem.find(params[:id])

    40:   end

index() click to toggle source

GET /line_items GET /line_items.xml

        # File app/controllers/line_items_controller.rb, line 6
     6:   def index

     7:     @line_items = LineItem.all

     8:

     9:     respond_to do |format|

    10:       format.html # index.html.erb

    11:       format.xml  { render :xml => @line_items }

    12:     end

    13:   end

new() click to toggle source

GET /line_items/new GET /line_items/new.xml

        # File app/controllers/line_items_controller.rb, line 28
    28:   def new

    29:     @line_item = LineItem.new

    30:

    31:     respond_to do |format|

    32:       format.html # new.html.erb

    33:       format.xml  { render :xml => @line_item }

    34:     end

    35:   end

show() click to toggle source

GET /line_items/1 GET /line_items/1.xml

        # File app/controllers/line_items_controller.rb, line 17
    17:   def show

    18:     @line_item = LineItem.find(params[:id])

    19:

    20:     respond_to do |format|

    21:       format.html # show.html.erb

    22:       format.xml  { render :xml => @line_item }

    23:     end

    24:   end

update() click to toggle source

PUT /line_items/1 PUT /line_items/1.xml

        # File app/controllers/line_items_controller.rb, line 63
    63:   def update

    64:     @line_item = LineItem.find(params[:id])

    65:

    66:     respond_to do |format|

    67:       if @line_item.update_attributes(params[:line_item])

    68:         format.html { redirect_to(@line_item, :notice => 'Line item was successfully updated.') }

    69:         format.xml  { head :ok }

    70:       else

    71:         format.html { render :action => "edit" }

    72:         format.xml  { render :xml => @line_item.errors, :status => :unprocessable_entity }

    73:       end

    74:     end

    75:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.