On 27 May 2010 18:32, anon_comp <neocools...@gmail.com> wrote:
>
>
> On May 27, 1:27 pm, anon_comp <neocools...@gmail.com> wrote:
>
>> > So what exactly is the problem then?  First look in the log file
>> > (log/development.log) and see if the parameter is being passed
>> > correctly when they submit.  If this is ok what do you want to do with
>> > his input?
>>
>> The parameters are being passed correctly. What I want to do is pass
>> the parameters to the command (added on to another command already in
>> it) despite the security issues already pointed out.
>
> That being said, I figured the issue out easly -headdesk-
>
> (for people who may or may not need it in the future and for
> documenting purposes...)
> trying_controller.rb
> ------------------------------------------------------------
> class TryingController < ApplicationController
>  def index
>  end
>
>  def to
>   �...@logfile = params[:logfile]
>    system('your_execute_file.exe', @logfile)
>  end
> end
>
> Now I need to figure out how to validate the file so that it can't be
> empty and it can't be any other format excpet with a .log as the
> extension.

Just do the checks on @logfile after you pick it up from params.  I
would suggest checking for nil first then a regular expression test to
check the format.  Google for ruby regular expression will give you
loads of clues.

Colin

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to