Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CustomersController < ApplicationController
- include ActionView::Helpers::NumberHelper
- # Many controller actions missing...
- def new
- @customer = Customer.new
- user = @customer.build_user
- end
- def edit
- # reformat phone w/ dashes when displayed for editing (preference; not required)
- @customer.phone = number_to_phone(@customer.phone)
- # should have a user associated with customer, but just in case...
- user = (@customer.user.nil? ? @customer.build_user : @customer.user)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement