0.0
No commit activity in last 3 years
No release in over 3 years
Click and edit any html element. Changes are saved to the database via ajax. When the page is loaded the changes will be injected into that element.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.10
~> 10.0
 Project Readme

Frendms

The Rails Frond End Management System.

Use this gem to modify the front end of any website on the fly via ajax.

Installation

Add this line to your application's Gemfile:

gem 'frendms-rails'

And then execute:

$ bundle

Or install it yourself as:

$ gem install frendms-rails

Usage

After installation execute:

$ rails g frendms

This will generate the migration for the elements table used to store element values. Use with Devise authentication to update front end elements on the fly via ajax. When logged in, any child elements of class "frender" with the class "frend" will be editable.

Add to the bottom of your layout file

<% if user_signed_in? %>
<script>
	$(document).ready(function(){
		$('.frend').addClass('enabled').attr('contenteditable', 'true')
	})
</script>
<% end %>

Example of an editable layout:

<html>
<body>
  <section class="frender" id="header">
    <header class="frend">I'm an editable header</header>
  </section>

  <section class="frender" id="<%= "#{controller_name}-#{action_name}" %>">
    <%= yield %> <!-- yield frend class elements per controller action -->
  </section>

  <section class="frender" id="footer">
    <footer class="frend">I'm an editable footer</footer>
  </section>
</body>

<% if user_signed_in? %>
<script>
	$(document).ready(function(){
		$('.frend').addClass('enabled').attr('contenteditable', 'true')
	})
</script>
<% end %>

</html>  

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/tysonholub/frendms-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.