Ruby on Rails Thursday, December 2, 2010

Okay, I've been doing some looking around and it looks like using the
redirect helper is what I need. Does this look it would work?

resources :movies
match "/:category/:movie" => redirect("netflix.com/search?category=%
{category}&name=%{movie}")

I don't exactly know what document to put this kind of code in though,
or in what context :(. The only point of the site would be to preform
that code though, like the site is extremely plain and basic. I don't
need statistics or anything (yet). A counter for the amount of
redirects would be nice though. How would I make a very basic app that
is just able to complete this code? There's a tiny part covering this
on railscasts.com, but he doesn't show making the actual app, just
using this little piece within it.

Thanks for taking the time to reply :)

On Dec 2, 6:07 am, MOLTEN <vincent.ciarav...@gmail.com> wrote:
> It looks like you may not have seen the beginning of this post, let me
> just repost what may not have showed on ruby-forum.com:
>
> "Is it possible to make a site that only preforms a redirect to
> another
> site? Here's an example:
>
> Let's just say that a netflix.com URL to a movie is something like
> netflix.com/search?category=Fantasy&name=Heroes&blahtechnical-stuff"
>
> I kinda thought about that, but I think one of the main parts of the
> site I'm trying to do is that it converts and substitutes things from
> my site to something on the site I'm redirecting to. For example:
>
> In netflixit.com/fantasy/heroes...
> netflixit.com converts to netflix.com/search?
> /fantasy/ converts to category=Fantasy
> /heroes/ converts to &name=Heroes
>
> So what I need it to do is both redirect and transform some of the
> stuff. There will only and always be 2 sections, such /category/
> title/, so that may make it easier. If a user doesn't put the correct
> amount of sections, I'll just take them to the home page
> netflixit.com, or whatever.
>
> On Dec 2, 5:54 am, Robert Walker <li...@ruby-forum.com> wrote:
>
>
>
>
>
>
>
> > MOLTEN wrote in post #965662:
>
> > > Could you make a really simple app in Rails at say the domain
> > > netflixit.com that allows people to just type in like netflixit.com/
> > > fantasy/heroes and be instantly directed to the netflix version? So, I
> > > guess it has to convert and change the URL, but I don't know how. The
> > > website would be pretty much blank. The only thing it would be used
> > > for is automatically redirecting to the netflix site. The idea is just
> > > to give people an easier way to find something in a database type site
> > > if they already know what they are looking for.
>
> > > This sounds like it would be very easy, but I'm still a beginner in
> > > Rails. I don't even know the correct term for what this would be
> > > called - might be easier to find information if I did :D
>
> > > So, does anyone know any tutorials that show how to do this, or at
> > > least know the technical term for this so I can do my own searching?
>
> > There are already many sites that do exactly this bit.ly, j.mp,
> > tinyurl.com, etc.
>
> > Yes, these sites do this for the express purpose of shortening the URL,
> > but what you're describing is really the same thing. Do a Google search
> > for URL shortening scripts and see how they work. That should get you
> > started.
>
> > --
> > Posted viahttp://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment