Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F448991
helper.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Apr 24, 12:56 PM
Size
1 KB
Mime Type
text/x-ruby
Expires
Sat, Apr 26, 12:56 PM (1 d, 14 h)
Engine
blob
Format
Raw Data
Handle
212306
Attached To
rWEBDNS WebDNS (edet4)
helper.rb
View Options
require_relative
'helpers/nested_form'
module
BootstrapForm
module
Helper
include
::
BootstrapForm
::
Helpers
::
NestedForm
def
bootstrap_form_for
(
object
,
options
=
{},
&
block
)
options
.
reverse_merge!
({
builder
:
BootstrapForm
::
FormBuilder
})
options
[
:html
]
||=
{}
options
[
:html
][
:role
]
||=
'form'
layout
=
case
options
[
:layout
]
when
:inline
"form-inline"
when
:horizontal
"form-horizontal"
end
if
layout
options
[
:html
][
:class
]
=
[
options
[
:html
][
:class
]
,
layout
].
compact
.
join
(
" "
)
end
temporarily_disable_field_error_proc
do
form_for
(
object
,
options
,
&
block
)
end
end
def
bootstrap_form_tag
(
options
=
{},
&
block
)
options
[
:acts_like_form_tag
]
=
true
bootstrap_form_for
(
""
,
options
,
&
block
)
end
def
temporarily_disable_field_error_proc
original_proc
=
ActionView
::
Base
.
field_error_proc
ActionView
::
Base
.
field_error_proc
=
proc
{
|
input
,
instance
|
input
}
yield
ensure
ActionView
::
Base
.
field_error_proc
=
original_proc
end
end
end
Event Timeline
Log In to Comment