开发者

Create resource from another site

I'm facing this problem, I have a model called Post and I'm creating a new post in this way

def create
   @post = Post.new(params[:post])
   @post.save
end

so, if I want to give at the user the possibility开发者_运维问答 to create a post from his website, what should I do? I need to create a sort of webservices? Thank you


Maybe I don't understand the question completely, but you essentially just want to provide to the user an api for interacting with your site programatically, so that they can create records in your app, right? In that case, your app should already work, but you'll probably want to provide an easier to parse return format, like xml or json, by using a render block. Maybe there is something else you're asking?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜