Hola tengo problema con forma simple joya Recibí un error cuando procesé el script:
app/views/docs/_form.html.haml:4: syntax error, unexpected ")"
app/views/docs/_form.html.haml:8: syntax error, unexpected "}", expecting keyword_end
app/views/docs/_form.html.haml:8: unterminated string meets end of file
app/views/docs/_form.html.haml:8: syntax error, unexpected end-of-input, expecting keyword_end
app/views/docs/new.html.haml:2:in `_app_views_docs_new_html_haml___3494450644670928784_70227155181520"
archivo de vista / documentos _form.html.haml
= simple_form_for @doc do |f|
= f.input :title
= f.input :content
= f.button :submit
new.html.haml
= render "form"
y docs.controller
class DocsController < ApplicationController
def index
end
def show
end
def new
@doc = Doc.new
end
def create
@doc = Doc.new(doc_params)
if @doc.save
redirect_to @doc
else
render "new"
end
end
def edit
end
def update
end
def destroy
end
private
def find_doc
end
def doc_params
params.require(:doc).permit(:title, :content)
end
end
Intenté agregar etiquetas <%%> a docs_form.html.haml pero aún no funciona
Respuestas
0 para la respuesta № 1Parece que su sangría no es correcta. Para lazo o bloquear En Haml, tienes que sangrar el código debajo de él. Hacerlo de esta forma:
= simple_form_for @doc do |f|
= f.input :title
= f.input :content
= f.button :submit