I have a view that explains a system and allows the user to submit content for publication. He just types in a textarea and this text is sent to a WP blog, along with his username and email, which turns him into a guest post.
The problem is that now I need to make a modification so that, in addition to sending the data to WP, the system saves them in the MySQL database associated with Rails. The record will have the user name, your email, and the article title (picking up the substring between the h1 tags).
I made the scaffold to generate the manipulation of the articles, but I can not do this part of capturing the title, because there is no $ _POST like in PHP. I searched everywhere and could not find a satisfactory solution. How can I make the information to be saved in the bank and then sent to the WP blog?
Current code snippet:
<%= hidden_field_tag :nome_autor, @current_user.name %>
<%= hidden_field_tag :email_autor, @current_user.email %>
<textarea name = "texto"><h1>SEU TÍTULO AQUI</h1><br>Escreva seu artigo aqui e nos envie!</textarea>
<button type = "submit">Enviar Artigo</button>