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
<?php | |
$model_object = parse_ini_file('object_map.ini'); | |
function __autoload($class_name) { | |
global $model_object; | |
$class_name = strtolower($class_name); | |
if (!isset($model_object[$class_name])) { | |
exit('invalid class name'); | |
} | |
require_once($model_object[$class_name]); |
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
<?php | |
$fp = fopen('object_map.ini', 'w'); | |
foreach($ini_config_data as $class => $filename) { | |
$write = $class . ' = ' . $filename . PHP_EOL; | |
fwrite($fp, $write, strlen($write)); | |
} | |
fclose($fp); | |
?> |
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
<?php | |
$model_object = parse_ini_file('object_map.ini'); | |
function __autoload($class_name) { | |
global $model_object; | |
$class_name = strtolower($class_name); | |
if (!isset($model_object[$class_name])) { | |
exit('invalid class name'); | |
} | |
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
<h1 id="page_title">Login</h1> | |
<%= render 'form' %> | |
<%= link_to 'Back', homepage_url %> |
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
<h1 id="page_title">Edit Your Profile</h1> | |
<%= render 'form' %> | |
<%= link_to 'Show', @user %> | | |
<%= link_to 'Back', homepage_url %> |
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 | |
# GET /users/1 | |
def show | |
@user = User.find(params[:id]) | |
end | |
# GET /users/new | |
def new | |
@user = User.new |
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
# GET /conversations/new | |
def new | |
@conversation = Conversation.new | |
@comment = @conversation.comments.build | |
respond_to do |format| | |
format.html # new.html.erb | |
end | |
end |
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
<%= form_for(@conversation, :url => board_conversations_path) do |f| %> | |
<% if @conversation.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@conversation.errors.count, "error") %> prohibited this conversation from being saved:</h2> | |
<ul> | |
<% @conversation.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> |
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
<%= form_for(@comment, :url => reply_board_conversation_url(:board_id=>@board, :id=>@conversation)) do |f| %> | |
<% if @comment.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@comment.errors.count, "error") %> prohibited this reply from being saved:</h2> | |
<ul> | |
<% @comment.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> |
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
# GET /conversations/reply | |
def reply | |
@conversation = Conversation.find(params[:id]) | |
@comment = @conversation.comments.build | |
respond_to do |format| | |
format.html #reply.html.erb | |
end | |
end | |