Frederick Cheung wrote:
> On Aug 4, 5:25�pm, 15characters 15characters <rails-mailing-
> [email protected]> wrote:
>
>> Whatever I do, whether check or not check, the value stored in the
>> database is always 1, I have tried setting different default values but
>> nothing seems to help.
>>
>> Can you advise what I'm doing wrong please? Thank ou
>
> What's in your controller ? Does the sql being executed look sane ?
>
> Fred
You mean this?
def create
@service_availability =
ServiceAvailability.new(params[:service_availability])
respond_to do |format|
if @service_availability.save
flash[:notice] = 'ServiceAvailability was successfully created.'
format.html { redirect_to(@service_availability) }
format.xml { render :xml => @service_availability, :status =>
:created, :location => @service_availability }
else
format.html { render :action => "new" }
format.xml { render :xml => @service_availability.errors,
:status => :unprocessable_entity }
end
end
end
or ...
def new
@service_availability = ServiceAvailability.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @service_availability }
end
end
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---