我想仅从选定范围替换特定字符串。 e.g
Started GET "/tracks/new" for 127.0.0.1 at 2017-09-18 12:51:19 +0200
Processing by TracksController#new as HTML
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ? [["id", 14], ["LIMIT", 1]]
Genre Load (0.2ms) SELECT "genres".* FROM "genres"
Rendering tracks/new.html.erb within layouts/application
Rendered tracks/_form.html.erb (7.3ms)
Rendered tracks/new.html.erb within layouts/application (12.0ms)
Completed 200 OK in 91ms (Views: 82.6ms | ActiveRecord: 0.6ms)
Started POST "/tracks" for 127.0.0.1 at 2017-09-18 12:51:58 +0200
Processing by TracksController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"kbvYCPTwS1WdI4lK3xLsnNKkrxJFo+y3mmJUIrhr5ceWjYQyjfqsVUNllQC1Ih13erBOi7VFFtNfjFuyPyhDlg==", "track"=>{"title"=>"Hello Sunshine", "description"=>"Track for Acoustic Style Videos", "price"=>"1.99", "audio"=>#<ActionDispatch::Http::UploadedFile:0x007feb1b300670 @tempfile=#<Tempfile:/var/folders/nn/k15ytbks3n30bk74txp8t2pc0000gn/T/RackMultipart20170918-13484-qqppq1.mp3>, @original_filename="Gravity by John Mayer.mp3", @content_type="audio/mp3", @headers="Content-Disposition: form-data; name=\"track[audio]\"; filename=\"Gravity by John Mayer.mp3\"\r\nContent-Type: audio/mp3\r\n">}, "genre_id"=>"1", "commit"=>"Create Track"}
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ? [["id", 14], ["LIMIT", 1]]
Command :: PATH=/usr/local/bin/:$PATH; file -b --mime '/var/folders/nn/k15ytbks3n30bk74txp8t2pc0000gn/T/a7583642b9fdf84dddb8dba14909ce6120170918-13484-c875vy.mp3'
[paperclip] Content Type Spoof: Filename Gravity_by_John_Mayer.mp3 (audio/mpeg from Headers, ["audio/mpeg"] from Extension), content type discovered from file command: application/octet-stream. See documentation to allow this combination.
(0.1ms) begin transaction
Genre Load (0.3ms) SELECT "genres".* FROM "genres" WHERE "genres"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
Command :: PATH=/usr/local/bin/:$PATH; file -b --mime '/var/folders/nn/k15ytbks3n30bk74txp8t2pc0000gn/T/a7583642b9fdf84dddb8dba14909ce6120170918-13484-1xhh8so.mp3'
[paperclip] Content Type Spoof: Filename Gravity_by_John_Mayer.mp3 (audio/mpeg from Headers, ["audio/mpeg"] from Extension), content type discovered from file command: application/octet-stream. See documentation to allow this combination.
(0.2ms) rollback transaction
Rendering tracks/new.html.erb within layouts/application
Rendered tracks/_form.html.erb (9.7ms)
Rendered tracks/new.html.erb within layouts/application (12.0ms)
Completed 500 Internal Server Error in 88ms (ActiveRecord: 0.7ms)
ActionView::Template::Error (undefined method `map' for nil:NilClass):
2: <%= simple_form_for @track do |f| %>
3: <%= f.input :title, label: "Track Name:" %>
4: <%= f.input :description %>
5: <%= select_tag(:genre_id, options_for_select(@genres), :prompt => "Select a Genre", class: "genre_select") %>
6: <%= f.input :price %>
7: <%= f.file_field :audio %>
8: <%= f.button :submit %>
app/views/tracks/_form.html.erb:5:in `block in _app_views_tracks__form_html_erb___4605380733745630_70323911562620'
app/views/tracks/_form.html.erb:2:in `_app_views_tracks__form_html_erb___4605380733745630_70323911562620'
app/views/tracks/new.html.erb:4:in `_app_views_tracks_new_html_erb___4047185287574205786_70323904027580'
app/controllers/tracks_controller.rb:34:in `create'
我只想删除所选范围 @Bob 中的最后一个单词,即使它包含整个发送的重复项,并希望在UItextfield swift上显示它。
有关更多信息,我正在寻找像添加和删除whatsapp组中标记朋友的内容。