そして、パーティーの説明を入れることができます。 また、ユーザーは説明としてリンクを入力できます。ユーザがウェブサイトリンクをtext_areaに配置し、Rails 4でクリック可能なリンクを表示するにはどうすればよいですか?
ただし、ユーザーが保存した後、入力したリンクはクリックできません。 リンク先のアドレスをコピーしてブラウザに貼り付け、サイトに移動する必要があります。以下は
はviews/parties/_form.html.erb
次のとおりです。ユーザーは任意のリンクを入力した場合
<%= form_for(@party, multipart: true) do |f| %>
<div id="error_explanation">
<ul><%= @party.errors.full_messages.first if @party.errors.any? %></ul>
</div>
<div class="field">
<%= f.label :title %><br>
<%= f.text_field :title, :class => "form-control", placeholder: 'Type title' %>
</div>
<div class="field">
<%= f.label :location %><br>
<%= f.text_field :location, :class => "form-control", placeholder: 'Type location' %>
</div>
<div class="field">
<div class="form-group">
<label>time</label>
<%= f.datetime_select :time %>
</div>
</div>
<div class="field">
<%= f.label :description %><br>
<a style="text-decoration:none;" title="Suggest!" data-toggle="popover" data-trigger="hover" data-placement="top" data-content="Ticket? Any Link? Tell me more!"><%= f.text_area :description, :class => "form-control", :rows => "3" %></a>
</div>
<div class="field">
<%= f.label :image %><br>
<%= f.file_field :image %>
</div>
<p>
</p>
<div class="actions">
<%= f.submit "Let's post it", :class => "btn btn-primary", :id => "load", 'data-loading-text' => "Uploading...".html_safe %>
</div>
<p>
</p>
<% end %>
は、どのように私はクリック可能なリンクへのリンクを変換することができますか?その説明を表示するとき?
For example, if a user typed,
"Hi we have party tomorrow at 12:00 pm.
Also more information is at www.facebook.com/samplepartybrabrabra
ticket is $5 per person."
ありがとう!出来た。私はその宝石をインストールする必要があった。 –