forked from cfwheels/Social-Network-Screencast
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chris Peters
committed
May 23, 2010
1 parent
31e661a
commit 61af9a7
Showing
9 changed files
with
89 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<cfcomponent extends="Controller" output="false"> | ||
|
||
<cffunction name="add"> | ||
|
||
<cfset status = model("status").new(params.status)> | ||
<cfset status.personId = loggedInUser.id> | ||
<cfif status.save()> | ||
<cfset flashInsert(success="Your status was updated.")> | ||
<cfset redirectTo(controller="main", action="home")> | ||
<cfelse> | ||
<cfset users = model("person").findAll(order="createdAt DESC", maxRows=3)> | ||
<cfset renderPage(controller="main", action="home")> | ||
</cfif> | ||
|
||
</cffunction> | ||
|
||
</cfcomponent> |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<cfcomponent extends="Model" output="false"> | ||
|
||
<cffunction name="init"> | ||
|
||
<!--- Associations ---> | ||
<cfset belongsTo("person")> | ||
|
||
<!--- Validations ---> | ||
<cfset validatesPresenceOf("message,personId")> | ||
<cfset validatesNumericalityOf(property="personId", allowBlank=true)> | ||
|
||
</cffunction> | ||
|
||
</cfcomponent> |
This file contains 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
This file contains 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