-
-
Save chrislerum/48ef935db0f69bd9b79c 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
class UsersController < ApplicationController | |
before_filter :authenticate_user! | |
before_filter :active_subscription? | |
before_filter(:only => [:show]) { |c| c.authorized_users_and_owner_and_admin_only ["investor"] } | |
def show | |
@user = User.find(params[:id]) | |
@profile = @user.profile | |
@subscription = @user.subscription | |
@plan = @user.plan || nil | |
if @profile.not_submitted? | |
@hidden_field_value = true | |
@hidden_field_name = :submitted | |
@button_message = "Submit for approval" | |
@button_confirmation = "Click OK to submit your profile for approval." | |
elsif @profile.pending_approval? | |
@hidden_field_value = false | |
@hidden_field_name = :submitted | |
@button_message = "Revoke Submission" | |
@button_confirmation = "Click OK to revoke your submission for approval." | |
elsif @profile.approved? && @profile.not_published? | |
@hidden_field_value = true | |
@hidden_field_name = :published | |
@button_message = "Publish" | |
@button_confirmation = "Click OK to publish your profile." | |
elsif @profile.approved? && @profile.published? | |
@hidden_field_value = false | |
@hidden_field_name = :published | |
@button_message = "Unpublish" | |
@button_confirmation = "Click OK to unpublish your profile." | |
end | |
render @user.user_type | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment