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?