已投简历
kindle 绝对就是移动的纸质书,关键是我买了很多书 20 几本 我 16 年 7 月才来上海的啊 搬家都不整
我买了还没看,不过能买到电子版的就好了可以放到 kindle 上
地址定位这一块 你是用的什么 gem
哦 好吧 从用户的角度 这里可能 不太建议这么设计
是的,武汉如果有,我肯定会考虑会武汉的 你的网站我刚刚看了下,前端样式还有些问题
赞一个,不过武汉的公司 ruby 的确很少,所以我去魔都了
你看的是什么教程,可以分享一下?
我还没有弄过 smtp 的邮箱 好吧
运行了一下 发现开发模式下注册还是有些问题,另外想问问楼主 配置百度地图是怎么配置网上配置 geocoder 的资料还是很少
ok
我就是问问,不过你见过我?
贵公司是使用 gem 写 API 还是?
这算报名成功了么,好想听听
报名
顶一个
看不懂 好像
你的简历还是去年那个,没改改
所以你投简历没有
赞一个
加油
@railsboy 你可以试试
这个怎么抽啊 看看我运气怎么样
太赞了,可以购买电子版的么
不行 还是报错
好的
这是目录
TopicsController
module Homeland
class TopicsController < Homeland::ApplicationController
before_action :authenticate_user!, only: [:new, :edit, :create, :update, :destroy, :reply]
before_action only: [:edit, :update, :destroy] do
authorize_resource! topic
end
def index
@topics = Topic.latest.includes(:user).page(params[:page])
set_seo_meta(t("homeland.nav.latest"))
end
def node
@node = Node.find(params[:id])
@topics = @node.topics.latest.includes(:user).page(params[:page])
render action: "index"
end
%w(recent features).each do |action|
define_method(action) do
@topics = Topic.send(action).includes(:user, :node).page(params[:page])
set_seo_meta(t("homeland.nav.#{action}"))
render action: "index"
end
end
def show
@topic = Topic.find(params[:id])
@replies = replies
set_seo_meta(@topic.title)
end
def new
@topic = Topic.new
@node = Node.find_by(id: params[:node_id])
set_seo_meta(t("homeland.nav.new"))
end
def reply
@topic = Topic.find(params[:id])
@reply = @topic.replies.build(reply_params)
@reply.user_id = current_user.id
if @reply.save
flash[:notice] = t('homeland.reply_created')
else
flash[:alert] = @reply.errors.full_messages.join("<br />")
end
redirect_to topic_path(params[:id],:anchor => "reply")
end
# GET /topics/1/edit
def edit
@node = @topic.node
end
# POST /topics
# POST /topics.xml
def create
@topic = Topic.new(topic_params)
@topic.user_id = current_user.id
if @topic.save
redirect_to(topic_path(@topic.id), notice: t('homeland.topic_created'))
else
render action: "new"
end
end
# PUT /topics/1
# PUT /topics/1.xml
def update
@topic = Topic.find(params[:id])
if @topic.update_attributes(topic_params)
redirect_to(topic_path(@topic.id), notice: t('homeland.topic_updated'))
else
render action: "edit"
end
end
# DELETE /topics/1
# DELETE /topics/1.xml
def destroy
topic.destroy
redirect_to(topics_path, notice: t('homeland.topic_deleted'))
end
private
def topic
@topic ||= Topic.find(params[:id])
end
def replies
@topic.replies.includes(:user).page(params[:page])
end
def topic_params
params.require(:topic).permit(:node_id, :title, :body)
end
def reply_params
params.require(:reply).permit(:body, :reply_to_id)
end
end
end
application_controller
module Homeland
class ApplicationController < ::ApplicationController
helper Homeland::ActionView::WillPaginate
helper Homeland::ApplicationHelper
helper_method :current_user, :owner?, :admin?
alias_method :origin_current_user, Homeland.config.current_user_method.to_sym
alias_method :origin_authenticate_user!, Homeland.config.authenticate_user_method.to_sym
def current_user
origin_current_user
end
def authenticate_user!
origin_authenticate_user!
end
def authorize_resource!(obj)
if !owner?(obj)
redirect_to homeland.root_path, alert: t('homeland.access_denied')
end
end
def authorize_admin!
if !admin?
redirect_to homeland.root_path, alert: t('homeland.access_denied')
end
end
def set_seo_meta(title = '', meta_keywords = '', meta_description = '')
@page_title = "#{title}" if title.length > 0
@meta_keywords = meta_keywords
@meta_description = meta_description
end
def owner?(obj)
return false if obj.blank?
return false if current_user.blank?
return true if current_user.send(Homeland.config.user_admin_method) == true
obj.user_id == current_user.id
end
def admin?
return false if current_user.blank?
current_user.send(Homeland.config.user_admin_method) == true
end
end
end
看了下,有些不明白有什么用处 只是记录生活