property_web_builder
https://github.com/etewiah/property_web_builder
Ruby
Create a fully featured real estate website on Rails in minutes! ⛺
Pwb::Page#set_fragment_visibility
def set_fragment_sort_order(page_part_key, sort_order)
page_fragment_content = contents.find_by_page_part_key page_part_key
# using join model for sorting and visibility as it
# will allow use of same content by different pages
# with different settings for sorting and visibility
unless page_fragment_content.present?
return
end
page_content_join_model = page_fragment_content.page_contents.find_by_page_id id
page_content_join_model.sort_order = sort_order
page_content_join_model.save!
endEdit
git clone [email protected]:etewiah/property_web_builder.git
cd property_web_builder
open app/models/pwb/page.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Pwb--Page-set_fragment_visibility-for-pr
# Commit to gitgit add app/models/pwb/page.rbgit commit -m "better docs for Pwb::Page#set_fragment_visibility"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Pwb--Page-set_fragment_visibility-for-pr
hub pull-request
# Celebrate!