# Would this be a good(restfull) approach for livesearch?

**URL:** <https://www.ruby-forum.com/t/would-this-be-a-good-restfull-approach-for-livesearch/118601>\
**Category:** Rails\
**Created:** [October 29, 2007, 12:57pm UTC](https://www.ruby-forum.com/t/would-this-be-a-good-restfull-approach-for-livesearch/118601 "2007-10-29T12:57:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![remcoh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c37758/32.png) [@remcoh](https://www.ruby-forum.com/u/remcoh)\
**Post date:** [October 29, 2007, 12:57pm UTC](https://www.ruby-forum.com/t/would-this-be-a-good-restfull-approach-for-livesearch/118601/1 "2007-10-29T12:57:57Z")

</div>

Hi,  
I want to implement a search feature with the rest principles in mind.  
so i try to think in resources and i decided to just put in in the index  
method.

this resource/method will be called form different places, for example a  
main search page for organisations but also on a “person” form in a  
sort of dialog screen where i can link an organisation to a person. the  
(live) search routine stays the same, but it needs to render a different  
partial. this is how i want to make my controller,

def index  
if not request.raw\_post==nil  
@phrase = request.raw\_post.chop  
@organisations=  
else  
@organisations=[]  
end  
respond\_to do |format|  
format.html { render :partial =\> params[:partial]}  
format.xml { render :xml=\>@organisations.to\_xml}  
format.rss { render :xml=\>@organisations.to\_rss}  
end  
end  
end

as you can see, i want to provide the partial to use through the url, so  
this would be something like: /organisations/index?partial=multicolumn  
or /organisations/index?partial=singlecolumn

i think it will work, but would this be considered restfull?
