Rails params explained?

Could anyone explain params in Rails controller: where they come from, and what they are referencing?

  def create
    @vote = Vote.new(params[:vote])
    item = params[:vote][:item_id]
    uid = params[:vote][:user_id]
    @extant = Vote.find(:last, :conditions => ["item_id = ? AND user_id = ?", item, uid])
    last_vote_time = @extant.created_at unless @extant.blank?
    curr_time = Time.now
  end

I would like to be able to read this code line-by-line and understand what’s going on.

5 Answers
5

Leave a Comment