Skip to content

Instantly share code, notes, and snippets.

View davydotcom's full-sized avatar

David Estes davydotcom

View GitHub Profile
<%customizable_form_for @test, :permissions => @current_user do |f|%>
<%=f.arrangeble_fields do%>
<%f.text_field :name%>
<%f.text_field :number%>
<%f.check_box :active%>
<%end%>
<%=field_set_tag "Custom Fields" do%>
<%=f.custom_fields :custom%>
<%end%>
@davydotcom
davydotcom / Service Layer Example.rb
Last active December 10, 2015 15:08
Example of creating a service class in Rails that uses exception raising
class Gl::TransactionsController < ApplicationController
def new
end
def create
teller = Gl::TellerService.new()
response = teller.transfer_funds(params)
if response.successful?
@transactions = response.data
respond_with @transactions