Code in View
<%= current_biz_user.welcome_to_snaplife %>
Output
Starburst::Announcement:0x77a0fd8
Method in BizUser Model Folder
def welcome_to_snaplife
Starburst::Announcement.create(:body => "Welcome to SnapLife")
end
Starburst.configuration do |config|
config.current_user_method = "current_user"
config.user_instance_methods = ["welcome_to_snaplife"]
end
I have two user models btw. I don't know if that's causing the problem while object is presenting in the view. How can I add both normal "current_user" and "current_biz_user" in the config file without breaking your solution?
Can you help me figure out why this error is showing please?
SQL (1.0ms) INSERT INTO "starburst_announcements" ("body", "created_at", "updated_at") VALUES (?, ?, ?) ["body", "Welcome to SnapLife"], ["created_at", "2015-04-05 23:38:24.839451"], ["updated_at", "2015-04-05 23:38:24.839451"] commit transaction
Code in View <%= current_biz_user.welcome_to_snaplife %>
Output
Starburst::Announcement:0x77a0fd8
Method in BizUser Model Folder def welcome_to_snaplife Starburst::Announcement.create(:body => "Welcome to SnapLife") end
Starburst.configuration do |config| config.current_user_method = "current_user" config.user_instance_methods = ["welcome_to_snaplife"] end
I have two user models btw. I don't know if that's causing the problem while object is presenting in the view. How can I add both normal "current_user" and "current_biz_user" in the config file without breaking your solution?