app.get('/blogs/new',function(req,res){res.render('blog_new.jade',{locals:{title:"新增文章",}});});app.post('/blogs/new',function(req,res){vararticle=newArticle({title:req.param('title'),body:req.param('body')});article.save(function(error){console.log("there is a error occured!");});res.redirect('/')});
//Begin the pathCGContextBeginPath(context);//Move around, add lines or arcs to the pathCGContextMoveToPoint(context,75,10);CGContextAddLineToPoint(context,160,150);CGContextAddLineToPoint(context,10,150);//Close the path (connects the last point back to the first) CGContextClosePath(context); // not strictly required//Actually the above draws nothing (yet)!//You have to set the graphics state and then fill/stroke the above path to see anything. [[UIColor greenColor] setFill]; // object-oriented convenience method (more in a moment) [[UIColor redColor] setStroke];CGContextDrawPath(context,kCGPathFillStroke);//kCGPathFillStrokeisaconstant
deflogin_or_oauth_requiredunlesssession[:shop]token=OAuth2::Provider.access_token(nil,[],request)unlesstoken.valid?renderjson:{error:'[API] Invalid API key or permission token (unrecognized login or wrong password)'}elsesession[:shop]||=token.owner.as_json(only:[:deadline,:created_at,:updated_at,:name])['shop']endendend
1. ActiveRecord::Base#dup and ActiveRecord::Base#clone semantics have changed to closer match normal Ruby dup and clone semantics.
1. Calling ActiveRecord::Base#clone will result in a shallow copy of the record, including copying the frozen state. No callbacks will be called.
1. Calling ActiveRecord::Base#dup will duplicate the record, including calling after initialize hooks. Frozen state will not be copied, and all associations will be cleared. A duped record will return true for new_record?, have a nil id field, and is saveable.
ActionMailer::Base.smtp_settings={:address=>"smtp.163.com",:port=>25,:domain=>"domail.com",:user_name=>"xxx@163.com",:password=>"xxx":authentication=>"plain",#if got the same error with me,please change the options false:enable_starttls_auto=>true}ActionMailer::Base.default_url_options[:host]="localhost:3000"