I am currently updating my application from rails 3.2 to rails 4. The following error has appeared.
ArgumentError (argument out of range):
This error occurred due to the following line of code
@lease.update_attributes(params[:lease])
I tried an update that also threw the same error. Is update_attributes from rails fixed. 4. How to use it?
code:
def terms_build_methods if @lease.blank? @lease = params[:current_lease_id].present? ? Lease.find_by_id(params[:current_lease_id].to_i) : Lease.create(params[:lease]) else @lease.update(lease_params) end Lease.update_lease_occupancy_type(@lease) Lease.update_lease_status(@lease) end private def lease_params params.require(:lease).permit! end
source share