Last active
November 24, 2016 04:38
-
-
Save staycreativedesign/83752ab3c9761528d589125b8a4cc36d to your computer and use it in GitHub Desktop.
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
.form-group | |
= f.label "Parent", class: "col-lg-2 col-md-2 col-sm-12 control-label" | |
.col-lg-10.col-md-10 | |
= f.select(:navigation_link_id, options_for_select((@top_level_links.collect { |p| [ p.name, p.id ] } << ["Top", nil]).reverse, selected: navigation_link.parent_id)) |
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
def top_level_links | |
@top_level_links ||= NavigationLink.all | |
end |
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
create_table "navigation_links", force: :cascade do |t| | |
t.string "path" | |
t.string "name" | |
t.integer "navigation_link_id" | |
t.datetime "created_at", null: false | |
t.datetime "updated_at", null: false | |
t.boolean "sublink" | |
t.integer "position" | |
t.index ["navigation_link_id"], name: "index_navigation_links_on_navigation_link_id", using: :btree |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment