开发者

I want actions not views

Rails is doing my head in.

I'm trying now to put something together to pull screen scraped data from site X through to client Y via a ruby script on server Z

I don't want views, I just want the request to look like domain.com/action/method

Inside routes.rb I have:

match ':controller(/:action(/:id(.:format)))'

But it still won't work. I just get ActionView::MissingTemplate in the log.

Achtung!

If I delibera开发者_Go百科tely put a faulty method in that subsequently calls render - the log file indicates the method executed badly, so I don't think it's something wrong with the "action" controller.

Update

Dreamhost's configuration needed me to specify ':layout => false'


So what do you want the app to respond with, if not something from a view? You can manually respond with a string like so:

def index
  render :text => "Hi from the #{controller_name} controller!"
end


If you don't want to render anything do this:

render :nothing => true

It sends a 200 OK response. Read more about it here: http://guides.rubyonrails.org/layouts_and_rendering.html#rendering-nothing

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜