V
V
V2016-08-04 12:51:57
MongoDB
V, 2016-08-04 12:51:57

How to parse request in Rails and compare the passed parameter with the value in the database?

Hello. I need to implement such a thing: there is a unique link by which the user goes exactly to his profile (consists of a host + an encrypted token). It is stored in the database. It is necessary to make it so that when following this link, the application parses the request, pulls out this encrypted part from the link and compares it with the database. Accordingly, if it finds the same value in the database as this encrypted part, then the user comes to himself. Yuzayu monga.

Answer the question

In order to leave comments, you need to log in

1 answer(s)

ActionController has a response method that contains all the bullshit you need.
Then, you need to either bind in before_action, or add logic to the controller.
type:

redirect_to @profile if response.query_string # здесь запрос в базу, я не ебу эти ваши пидерские nosql базы

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question