> About the end, its could be that a 'do' is missing a 'else' is incorrect, or
> a missed an 'end' somewhere.
>
> On Wed, Jun 29, 2016 at 4:39 PM, Ruth Stephenson <[email protected]
> <mailto:[email protected]>> wrote:
> Than you so much for your reply and your help! I'm still a little
> confused however as I'm still getting an error:
>
> syntax error, unexpected end-of-input, expecting keyword_end
>
> I don't know why it's complaining about end keywords. As far as I can
> tell they are ok.
> appointments controller:
>
> def create #(needs end 1)
> @appointment = Appointment.new(appointment_params)
>
> respond_to do |format| #(needs end 2)
> unless @appointments.isValid? #(needs end 3)
>
>
>
> if @appointment.save #(needs end 4)
> format.html { redirect_to @appointment, notice: 'Appointment
> was successfully created.' }
> format.json { render :show, status: :created, location:
> @appointment }
> elsif
> format.html { render :new }
> format.json { render json: @appointment.errors, status:
> :unprocessable_entity }
> else
> redirect_to root_path
> end #(end 4)
> end #(end 3)
> end #(end 2)
Where is "end 1"? Your indentation is hiding the problem from you as the
"unless..." isn't indented further than the "respond_to do ..."
-Rob
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/D7B78BC4-265A-4E5C-8447-0E0A7D0001D2%40agileconsultingllc.com.
For more options, visit https://groups.google.com/d/optout.