Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Convert params to appropriate types on Model.new(params[:model]) in rails

#6

Currently sets them all as strings so if it gets saved, it saves as inputted string without the padding/offsets.

Eg:

class MyModel < SimpleRecord::Base
   has_ints :x
end

Now say in view, you enter:

x: 123

now in controller, you do:

mm = MyModel.new(params[:my_model])
mm.save

123 will be saved directly without offset/padding. So when you retrieve the object, it will be some big negative number.

Reported by travis (at appoxy) · October 9th, 2009 @ 10:57 AM

State: new
Milestone: none
Assigned to: nobody

Activity

No comments yet.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.