2012-07-23 3 views
1

formtastic 제출 단추를 단추 대신 링크로 사용하여 스타일을 지정하려고합니다.formtastic 버튼을 링크로 변환하는 방법은 무엇입니까?

<%= f.actions do %> 
    <%= f.action :submit, :label => "Sign in", :as => :link %> 
<% end %> 

위와 같이 입력하면 "Formtastic :: UnsupportedMethodForAction"오류가 발생합니다.

내가 rdoc.info/github/justinfrench/formtastic#The_Available_Inputs

<%= f.actions do %> 
    <%= f.action :submit, :as => :button %> 
    <%= f.action :cancel, :as => :link %> 
<% end %> 

에서 다음 예제 코드를 발견하고 내가

<%= f.action :submit, :as => :link %> 

로 변경하면 위의 코드가도 실패합니다 : 지원되지 링크 : =>과 같이 제출 하시겠습니까?

미리 감사드립니다. 당신은 당신이 아니라 CSS를 사용하여이 작업을 수행해야한다 액션 사용 link_to "Profile", :controller => "profiles", :action => "create", :id => @profile, :method => :post

답변

3

<input type="button" value="Sign in">

를 생성합니다. 다음과 같이 시도하십시오.

#submit-button-selector { 
    background: none; 
    border: none; 
    color: blue; 
    text-decoration: underline; 
    display: inline; 
} 
2

에 응답하는 링크를 원하는 경우