2010년 5월 3일 월요일

Ruby; link_to 사용법



근데 :confirm이 먹지 않는다. 찾아보니, javascript를 include해야 하는 것 같은데...
넣어도 안되네? 왤까...

==> 순서가 중요함.

  • <%= link_to c.username, {:controller=> 'user', :action => 'show', :username=>c.username }, :confirm=>"Sure?"%>

    요기서 보는 바와 같이 :confirm은 두번쨰 옵션이 되어야 함. 즉, { ... }에 있는게 옵션1, :confirm은 옵션2가 되어야 함.

    털썩.... 구리다....


    Refer))
    http://www.tutorialspoint.com/ruby-on-rails-2.1/rails-html-links.htm
    http://www.ruby-forum.com/topic/174513
  • 댓글 없음:

    댓글 쓰기