解决了~
set $sub_domain “”;
if ( $host ~* (.*)\.baidu\.com ){
set $sub_domain $1;
}
if ( $sub_domain != “www” ){
rewrite ^/([a-zA-Z]+)(\d+)/(\w+).html$ /index.php?domain=$sub_domain&page=$1&size=$2&id=$3 last;
}
#4 楼 @sandtears 应该要反一下,操作的 host 是对所有非 ^www.aa.com 的域名
有人会麽?
选择 php 做网站我觉得更快速!尤其用框架,自动生成神马的,php 都有!
我用旋风离线已经能满足要求了~
我家网速最高 60k,我买了会员后下载能到 600k 麽?
#6 楼 @putty 在 development.rb 下需要配置什么参数?我的是:
JazzHands::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
# Raise exception on mass assignment protection for Active Record models
config.active_record.mass_assignment_sanitizer = :strict
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
config.active_record.auto_explain_threshold_in_seconds = 0.5
# Do not compress assets
config.assets.compress = false
# Expands the lines which load the assets
config.assets.debug = true
end
#4 楼 @xjz19901211 用这个 Rails.logger.info('xxx'),在 rails s 后面的滚动日志列表里还是看不到任何信息,这跟环境有关系?还是 rails s 后要加什么参数?
最好有简单的 CURD 操作的开源代码,我就想看看高手是如何读写数据库的,有木有? 当然不是脚手架生成的那么简单的~
def self.get_cate_news(categories = [])
ret = []
categories.each do |item|
img = self.get_news_list(false, false, "n.classid = '#{item.id}'", 'n.id desc', '2', '0')
hot = self.get_news_list(false, false, "n.classid = '#{item.id}' and imgurl<>''", 'n.id desc', '12', '0')
ret.append({:id => item.id, :classname => item.classname, :img => img, :hot => hot})
end
ret
end
只能这样了~
undefined method `img=' for GgClasslist id: 1, classname: "穿越小说" item 不就是一个 hash 对象吗?它本身有 id,classname 两个 key,我们怎么不能新增 key?
嗯 我用了 2 楼 Reverse engineering 工具生成的也是#4 楼 @oldfritter 产生的格式~