便å©ãªlink_to(link_toç³»ã¡ã½ããã¨optionã®ç´¹ä»)
railsã®link_toã¡ã½ããã£ã¦ä¾¿å©ã§ãããæè¿æãã¦ããã£ãã¡ã½ããã«
link_to_ifã¨ããã¡ã½ãããæãæ§ã§ãã
link_to_if(condition, name, options = {}, html_options = {}, *parameters_for_method_reference, &block)
conditiongãtrueã®å ´åãaã¿ã°ã表示ãã¦ããã¦ãfalseã®å ´åã¯ååã ããããã
ããã¦ãã®éã®link_to_unlessããã£ãã
link_to_ifãlink_to_unlessãå ±ã«ä¾¿å©ã§ããã
å¾ãã®ä»ã«ãlink_to_unless_currentã¨ããã®ãæã£ã¦ãã¡ãã¯
link_to_unless_current(name, options = {}, html_options = {}, *parameters_for_method_reference, &block)
ã¨ããå½¢ã
ä»æ¥ã¦ãããã¼ã¸ã¨ãªã³ã¯å
ã®URLãä¸è´ããã®ã§æãã°ãååã ãã§aã¿ã°ãåãé¤ãã¨ãããlayoutç³»ã®ã¡ãã¥ã¼ç»é¢ã«
使ãã¨ãããããªã¡ã½ããã
è¯ãã§ããã¼ã
便å©ã§ããã¼ã
ã¨ããããã§ãjavascriptã®nlink_to_function,link_to_remoteãå«ããã¨link_toçãªã¡ã½ããã¯
ãããªã«æãæ§ã§ãã
link_to
link_image_to
link_to_unless
link_to_unless_current
link_to_if
link_to_function
link_to_remote
mail_to
ã¤ãã§ãªã®ã§ãlink_toã§ã®ãªãã·ã§ã³ã¨ãã調ã¹ã¦ã¿ãã
:confirm â確èªãã©ã¼ã ãåºãã
è¨è¿°ä¾ï¼<%= link_to("link_name", {:action => "index"},{:confirm => "移åããï¼"}) %>
:popup â ãããã¢ããã¦ã£ã³ãã¦ã§éã
è¨è¿°ä¾ï¼<%= link_to("link_name", {:action => "index"},{:popup => ['new_window', 'height=300,width=600']}) %>
:method âpostçã§éä¿¡ã§ãã
è¨è¿°ä¾ï¼<%= link_to("link_name", {:action => "index"},{:method => :post}) %>
ãããªããã£ããã ãããã
railsã£ã¦è²ã
ã¨ãã«ãã¼å
å®ãã¦ããã©æ£ç´è¦ããããªãã»ã»ã»ã»