Frederick Cheung | 1 Dec 2008 01:06
Picon
Gravatar

Re: Formatting issue


On Nov 30, 11:36 pm, John Victor <rails-mailing-l...@...>
wrote:
> I have a text file that has data in it which is perfectly formatted the
> way I want it.
> I have the following code in my controller to open the file and read
> each line into an array which I then call from my view. The problem is,
> I completely loose the formatting the way I'm doing it:

<%= ... %> basically just calls to_s on whatever the expression in
there evaluates to, and to_s on an Array is just the concatenation of
to_s called on everything in it. If you just want to display data from
the file, why not use  <at> my_data = File.read(...) ?

Fred

>
> - from my controller:
> <code>
> def index
>          <at> ssh = Array.new
>         a = File.open("/usr/bin/my_data.dat")
>         a.each do |line|
>             <at> my_data.push(line)
>         end
> end
> </code>
>
> -from my view:
> <code>
(Continue reading)

John Ivanoff | 1 Dec 2008 01:25
Picon
Gravatar

Re: setup rails


http://instantrails.rubyforge.org/wiki/wiki.pl

http://instantrails.rubyforge.org/wiki/wiki.pl?Rolling_With_Ruby_On_Instant_Rails_Tutorial

On Nov 30, 9:38 am, Ideale Ideale <rails-mailing-l...@...>
wrote:
> please help ;((
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Zhao Yi | 1 Dec 2008 01:47

Re: How can I set default value for text_field?


Petan Cert wrote:
> Zhao Yi wrote:
>> Please this code:
>> 
>> <p>
>>     <%= f.label :"Host Name" %><br />
>>     <%= f.text_field :HostName %>
>> </p>
>> 
>> I want to set a default to this text field, how can I do this?
> 
> Is this what you looking for?
> <%= f.text_field :HostName, :value => "my default value" %>

Yes, this is exactly what I am looking for.

thanks.
--

-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Zhao Yi | 1 Dec 2008 01:48

How can I use before_filter?


This is my code:

before_filter :authorize, :except=>:login

This is one exception, "login" but I want to add more exceptions. How
can I do this?
--

-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

s.ross | 1 Dec 2008 01:54
Picon

Re: How can I use before_filter?


On Nov 30, 2008, at 4:48 PM, Zhao Yi wrote:

>
> This is my code:
>
> before_filter :authorize, :except=>:login
>
> This is one exception, "login" but I want to add more exceptions. How
> can I do this?
> -- 

before_filter :authorize, :except=>[:login, :reset_password]

--~--~---------~--~----~------------~-------~--~----~
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-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

pepe | 1 Dec 2008 01:55

Re: Database password encryption


Hello to all. Sorry to have answered this late, I've been out for
Thanksgiving.

Wow! I didn't know I knew so little about securing servers. :) Thanks
so much to all of you for all your answers.

I have to agree. I have always thought that keeping the bad guys out
should be done by the people that are best supposed to know about it,
the network and security guys. I am just a lowly coder. :)

My guess is that the thought behind the password encryption request is
really to try and make life a bit more difficult to the less skilled
inside hackers (read here their own employees). Not long ago I was
told by a security expert that over 90% of hack attacks are insider
jobs.

I'll pass along a link to this discussion to the person in charge. I
hope they realize that the password encryption is not the solution to
the problems they're trying to prevent.

Many thanks to all of you.

Pepe

On Nov 27, 1:40 pm, "Jean-Marc (M2i3.com)" <jean-marc.lag...@...>
wrote:
> Funny this would end up on a discussion on Rails.
>
> We have clients on other products asking to encrypt the passwords and
(Continue reading)

Zhao Yi | 1 Dec 2008 02:00

Re: How can I use before_filter?


Steve Ross wrote:
> On Nov 30, 2008, at 4:48 PM, Zhao Yi wrote:
> 
>>
>> This is my code:
>>
>> before_filter :authorize, :except=>:login
>>
>> This is one exception, "login" but I want to add more exceptions. How
>> can I do this?
>> -- 
> 
> before_filter :authorize, :except=>[:login, :reset_password]

it works, thanks very much.
--

-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

John Victor | 1 Dec 2008 03:03

Re: Formatting issue


Here is the data, if you put it in a file and then tell Rails to read 
it, please see if you can get it to display in the exact same format in 
Rails. When I do it, all my columns don't line up:

Mod Ports Card Type                              Model 
Serial No.
--- ----- -------------------------------------- ------------------ 
-----------
  1   48  48 port 10/100 mb RJ-45 ethernet       WS-X6248-RJ-45 
SAD041509MC
  2   48  48 port 10/100 mb RJ-45 ethernet       WS-X6248-RJ-45 
SAD041206F6
  3   16  16 port 1000mb MTRJ ethernet           WS-X6416-GE-MT 
SAD04220ML4
  4   48  48 port 10/100 mb RJ-45 ethernet       WS-X6248-RJ-45 
SAD03465383
  5    2  Supervisor Engine 720 (Active)         WS-SUP720-3B 
SAL092750VP
  6    2  Supervisor Engine 720 (Warm)           WS-SUP720-3B 
SAL09285BW6
  7   48  48 port 10/100 mb RJ-45 ethernet       WS-X6248-RJ-45 
SAD041509MY
  8   48  CEF720 48 port 10/100/1000mb Ethernet  WS-X6748-GE-TX 
SAL09285L96
  9    6  Firewall Module                        WS-SVC-FWM-1 
SAD084305Y3

Mod MAC addresses                       Hw    Fw           Sw 
Status
(Continue reading)

Jason Smith | 1 Dec 2008 03:07

rails 2.1.2 to rails 2.2.2 now I get mysql issues


After opening http://localhost:3000/ in browser, under About your
application's environment get this error:
LoadError in Rails/infoController#properties
193: %1 is not a valid Win32 application.   -
C:/jinstalled/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.3-x86-mswin32/ext/mysql.soRAILS_ROOT:
c:/Jinstalled/Apache Software Foundation/Apache2.2/htdocs/shovell

get the following when I jump into my ruby application(i.e
localhost:3000/stories/ )
193: %1 is not a valid Win32 application.   -
C:/jinstalled/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.3-x86-mswin32/ext/mysql.so

My setup.  I'm running Windows Vista Ultimate x64 edition(still crap).

I had rails 2.1.2 and updated to 2.2.2 and now get the above error.
Ruby -v = 1.8.6
gem -v = 1.3.1
I have mysql-essential-5.0.67-winx64
The service is up and running and I can log in and manipulate the
database just fine.

if I run ruby script\console
>require 'rubygems'
=> []
>require 'mysql'

I get a popup that says: ruby.exe - Unable to Locate component
This application has failed to start because LIBMYSQL.dll was not found.
re-installing the application may fix this problem.
(Continue reading)

pepe | 1 Dec 2008 03:13

Re: Populate a popup menu based on another menu selection


Have you heard of observe_field?

Pepe

On Nov 28, 10:28 am, Paul Finer <rails-mailing-l...@...>
wrote:
> Can anyone help me this?
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Gmane