Then again, if I''d had my first cup of coffee already I''d have
noticed
that the REAL problem is that @file is nil, so you''ll need to examine
how @file is set and test for it being set to nil before you do the gsub.
DOH!
David Schmidt (AFTER first cup of coffee...)
davids@tower-mt.com
David Schmidt wrote:> The problem is with the ''!'' in the gsub. That indicates
that the
> substitution should take place in the original string.
>
> The cleanest solution is to simply remove the "@file =" from the
front:
>
> @file.gsub!(/^.*(\\|\/)/, '''') # replace html tags with
blank
>
> But you could also remove the ! and keep the variable assignment:
>
> @file = @file.gsub(/^.*(\\|\/)/, '''') # replace html
tags with blank
>
>
> David
> davids@tower-mt.com
>
> Fird Abrar wrote:
>> #{RAILS_ROOT}/app/controllers/start_controller.rb:13:in
`create''
>> ---
>>
>> class StartController < ApplicationController
>>
>> def create
>>
>> #------------Remove Tag---------------------------
>>
>> @name = params[:name]
>> @file = params[:filepath]
>>
>> @file = @file.gsub!(/^.*(\\|\/)/, '''') # replace
html tags with blank
>>
>> post = Post.save(@params["removetag"])
>> end
>>
>> end
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails