1
I have a view that explains a system and allows the user to send content for publication. It just type in a textarea and this text is sent to a WP blog, along with your username and email, which turns it 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 registration will have the user’s name, e-mail address and article title (taking the substring between the H1 tags).
I scaffolded to generate article manipulation, but I can’t do this part of the title capture, because there is no $_POST like in PHP. I looked 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>
But how can I send to the WP page after?
– Eduardo
@Eduardo edited the answer.
– Luiz Carvalho