On Aug 4, 5:37 pm, 15characters 15characters <rails-mailing-
[email protected]> wrote:
> Frederick Cheung wrote:
> def create
> @service_availability =
> ServiceAvailability.new(params[:service_availability])
You're doing this, but that checkbox submits params[:service][:Monday]
so it won't ever be used.
fred
>
> 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 viahttp://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
-~----------~----~----~----~------~----~------~--~---