This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Swift 4 版 (String の extension として実装) | |
extension String { | |
// set `lower = false` in case you want "UpperCamel" output. | |
func camelized(lower: Bool = true) -> String { | |
guard self != "" else { return self } | |
let words = lowercased().split(separator: "_").map({ String($0) }) | |
let firstWord: String = words.first ?? "" | |
let camel: String = lower ? firstWord : String(firstWord.prefix(1).capitalized) + String(firstWord.suffix(from: index(after: startIndex))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%li.page-item.prev{ class: "#{'disabled' if current_page.first?}" } | |
= link_to (current_page.first? ? "#" : url), class: "page-link", "aria-label" => "First", :remote => remote do | |
%span{"aria-hidden" => "true"} « | |
%span.sr-only | |
= t('views.pagination.first').html_safe |