2011-10-17 3 views
0

에 오류가 표시되지 client_side_validation 및 오류가에 표시되지 내 표준레일 내가 <a href="https://github.com/bcardarella/client_side_validations" rel="nofollow">https://github.com/bcardarella/client_side_validations</a> 지침과의 Railscast하지만 여전히 레이블이 사라를 따라 라벨을 제거하고 사업부

<% if @contactmail.errors.any? %> 
    <div id="errorExplanation" class="contact-error"> 
    <ul> 
    <% @contactmail.errors.full_messages.each do |msg| %> 
     <li><%= msg %></li> 
    <% end %> 
    </ul> 
    </div> 
    <% end %> 

나는 레일 3.1과 루비 1.9를 사용 0.3

+0

컨트롤러에서 수행 한 업데이트 작업을 알려주십시오. –

답변

0

@contact = Contact.find(1) 


    respond_to do |format| 
    if @contact.update_attributes(params[:contact]) 

     params[:notice] = 'Texten sparad' 

     format.html { render action: "edit", :layout => 'admin' } 
     format.json { head :ok } 
    else 

     format.html { render action: "edit", :layout => 'admin' } 
     format.json { render json: @contact.errors, status: :unprocessable_entity } 
    end 
    end