Last active
November 27, 2016 22:19
-
-
Save staycreativedesign/b96ad90e4c23f6bc6762b2ee80d29fda to your computer and use it in GitHub Desktop.
This file contains hidden or 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_for [:admin, navigation_link] do |f| | |
.row.mt20 | |
.col-sm-12 | |
.panel.panel-default | |
.panel-heading | |
%h4.panel-title= title | |
.panel-body.form-horizontal | |
.form-group | |
= f.label :name, class: "col-lg-2 col-md-2 col-sm-12 control-label" | |
.col-lg-10.col-md-10 | |
= f.text_field :name, class: "form-control" | |
.form-group | |
= f.label :position, class: "col-lg-2 col-md-2 control-label" | |
.col-md-1 | |
= f.text_field :position, class: "form-control" | |
.col-md-4 | |
= f.label :path, class: "col-lg-2 col-md-2 col-sm-12 control-label" | |
= f.select :path, Page.all.collect {|p|[p.url_link_name, p.slug ] } << ["blogs", "/blogs"] << ["none", "#"] | |
.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, @navigation_links.collect { |p| [ p.name, p.id ] } << ["Top", nil], {class: 'form-control'}, selected: f.object.name |
This file contains hidden or 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
[1] pry(#<Admin::NavigationLinksController>)> params | |
=> <ActionController::Parameters {"utf8"=>"✓", "authenticity_token"=>"/py7B4Oy+X8kTaf62AyeJISWLuT4B9Ztot/mh/QaD6Hn16k/t4KpjW4+aWwdTFng3erGI1t9IqkhKbn9FMEyMg==", "navigation_link"=>{"name"=>"zzzz22", "position"=>"2", "path"=>"zzzzz", "navigation_link_id"=>"18"}, "commit"=>"Save Link", "controller"=>"admin/navigation_links", "action"=>"create"} permitted: false> |
This file contains hidden or 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.integer "page_id" | |
t.index ["navigation_link_id"], name: "index_navigation_links_on_navigation_link_id", using: :btree | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment