@@ -80,20 +80,6 @@ def update_button_to(link, options = {})
8080 _link_to link , { icon : "check" , type : "success" , text : "Restore" , size : "xs" } . merge ( options ) , properties
8181 end
8282
83- def dropdown_button ( id , options = { } )
84- options [ :type ] = ( options [ :type ] || "primary" ) . prepend ( "btn-dropdown btn-" )
85- options [ :id ] = id
86- additional_properties = {
87- data : {
88- "bs-toggle" : "dropdown"
89- } ,
90- "aria-haspopup" : true ,
91- "aria-expanded" : true
92- }
93-
94- _button_to ( { submit_type : "button" , text : "Set the 'text' property" , size : "md" , icon : "caret-down" } . merge ( options ) , additional_properties )
95- end
96-
9783 def cancel_button_to ( link , options = { } )
9884 _link_to link , { icon : "ban" , type : "outline-primary" , text : "Cancel" , size : "md" } . merge ( options )
9985 end
@@ -185,8 +171,16 @@ def _link_to(link, options = {}, properties = {})
185171
186172 klass = "#{ options [ :class ] || "" } btn btn-#{ type } btn-#{ size } #{ center } #{ disabled } "
187173
188- link_to link , properties . merge ( class : klass ) do
189- fa_icon icon , text : text
174+ form_klass = "#{ options [ :form_class ] || "" } d-inline-block"
175+
176+ if properties [ :method ] . blank? || properties [ :method ] == "get"
177+ link_to link , properties . merge ( class : klass ) do
178+ fa_icon icon , text : text
179+ end
180+ else
181+ button_to link , properties . merge ( class : klass , form_class : form_klass ) do
182+ fa_icon icon , text : text
183+ end
190184 end
191185 end
192186
0 commit comments