RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: thatRailsGuy
Not sure if you figured it out, but just ran into the same problem.
in the strong_params method, you must make tags an array
def article_params params.require(:article).permit(:name, :content, :published_at, tags: []) end
seconded.
To use multicolumn sorting, I did this:
def sort_helper columns = %w[name category released_on price] sort = "#{sort_column} #{sort_direction}" (params[:iSortingCols].to_i-1).times do |i| sort << ", #{columns[params["iSortCol_#{i+1}"].to_i]} #{params["sSortDir_#{i+1}"] == "desc" ? "desc" : "asc"}" end sort end def fetch_products products = Product.order("#{sort_helper}") products = products.page(page).per_page(per_page) if params[:sSearch].present? products = products.where("name like :search or category like :search", search: "%#{params[:sSearch]}%") end products end
Not sure if you figured it out, but just ran into the same problem.
in the strong_params method, you must make tags an array
seconded.
To use multicolumn sorting, I did this: