Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F461184
settings_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
Sat, May 17, 11:37 PM
Size
787 B
Mime Type
text/x-ruby
Expires
Mon, May 19, 11:37 PM (21 h, 49 m)
Engine
blob
Format
Raw Data
Handle
220107
Attached To
rARCHIVING archiving
settings_helper.rb
View Options
module
SettingsHelper
# Creates an html table for the given attributes
#
# @example table_for( a: 1, b: 2 )
# <div>
# <table>
# <tr>
# <td><b>A</b></td>
# <td>1</td>
# </tr>
# <tr>
# <td><b>B</b></td>
# <td>2</td>
# </tr>
# </table>
# </div>
#
# @param attributes[Hash]
# @return [String] Html table
def
table_for
(
attributes
)
content_tag
(
:div
,
class
:
'table-responsive'
)
do
content_tag
(
:table
,
class
:
'table table-striped table-bordered table-condensed'
)
do
attributes
.
map
{
|
key
,
value
|
"<tr><td><b>
#{
key
.
to_s
.
titleize
}
</b></td><td>
#{
value
}
</td></tr>"
}
.
inject
{
|
result
,
element
|
result
.
concat
(
element
)
}
.
html_safe
end
end
end
end
Event Timeline
Log In to Comment