Posted
27 Jul 2006 @ 14:46

Categories

Comments
None

Author
Alex

Downtime & Absence

I’ve just received notice from my hosting provider that the website will experience some downtime tonight (27th July) between 23:00 and 3:00 GMT. Just thought it would be best to let you know so you’re not left wondering where this wonderful website has gone.

I am having a break for the next two weeks starting Saturday morning. During this time there will be no new posts or new software releases and I will not be contact-able through the contact form or by email. If you have any serious problems with any of the software or the website not functioning contact me in the next 24 hours and I will try and sort the problems before I leave.

Have a good summer everyone. I will be back soon.

Posted
24 Jul 2006 @ 14:44

Categories
,

Comments
None

Author
Alex

Localization

Recently, I have had a closer look at the website logs and noticed, to my surprise that I am getting a lot of hits from German users, especially to the software pages. I have therefore decided to start work on localizing iSyncIt, my primary application, into German. I am aiming to have the localization integrated from the 1.0 releases for now, the 0.x releases will remain in English only.

If you are German speaking and what your name in the credits for iSyncIt then; use the application, translate all of the strings and messages in it and contact me with the localized strings. If nobody comes forward to help with this momentous task then I will be performing the translations with Babel Fish.

On a side note, iSyncIt 0.7 has just been released, there aren’t many changes in this release, just the ability to add iSyncIt to your ‘Login Items’. You can download it here.

Posted
21 Jul 2006 @ 21:02

Categories
,

Comments
8 Comments

Author
Alex

An Email Form with Ruby on Rails

The one thing that I’ve been struggling with the most during my Ruby on Rails learning curve is how to create a simple email form for any web applications I may want to create. There was nothing to be found on Google so in my initial attempt I worked through the ActionMailer documentation on the RoR wiki website. I put it all together and, feeling really pleased with myself, clicked the send button. Nothing at all, just lists of errors, so I modified it and still more errors. After posting on Ruby Forum and with the help of a talented member I finally got it working.

This post is for all the people like me who don’t know what to do.

First of all, this tutorial assumes that you already have a basic RoR web application set up with a ‘Contact’ controller and a main view for the index in the controller.

Now the real work starts. Open up a terminal session (or SSH) and navigate to your rails application’s directory (for this tutorial the rail application will be ‘rails_app’).

localhost:~ User$ cd /rails_app

Then create the mailer, ‘Emailer’ is the name of the model that will be produced.

localhost:~ User$ ./script/generate mailer Emailer

Now, that’s all the terminal work done. Lets start the setup.

In your chosen editor open the file ‘/rails_app/config/environment.rb’ and place the following inside the ‘Rails::Initializer’ block customizing all the necessaries to your SMTP server’s configuration.

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
    :address => 'localhost',
    :domain => 'website.co.uk',
    :port => 25,
    :authentication => :login,
    :user_name => "smtp_username",
    :password => "smtp_password"
}
  
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = false
config.action_mailer.default_charset = "utf-8"

Now open the file ‘/rails_app/app/models/emailer.rb’ and make it look like the below, again customizing the necessaries (but do not touch the variables).

class Emailer < ActionMailer::Base
    def contact_email(email_params)
        # You only need to customize @recipients.
        @recipients = "contact@website.co.uk"
        @from = email_params[:name] + " <" + email_params[:address] + ">"
        @subject = email_params[:subject]
        @sent_on = Time.now
        @body["email_body"] = email_params[:body]
        @body["email_name"] = email_params[:name]
        content_type "text/html"
    end
end

In the controller for your contact page you will need to make the following changes, basically, adding a definition for ‘send_mail’.

def send_mail
    Emailer::deliver_contact_email(params[:email])
end

Go to the ‘/rails_app/views/emailer’ folder and create a file called ‘contact_email.html.erb’. In this file place the following code.

<p>Name:</p>
 
<p><%= @email_name %></p>
 
<p>Message:</p>
 
<p><%= @email_body %></p>

The final step is to create a form on the ‘Contact’ page that will allow the website to user to input and submit the email. An example for is illustrated below.

<% form_for :email, :url => { :controller => 'contact', :action => 'send_mail' } do |f| %>
    <%= f.label :name %><br />
    <%= f.text_field :name, :size => 60 %><br />
    <%= f.label :address %><br />
    <%= f.text_field :address, :size => 60 %><br />
    <%= f.label :subject %><br />
    <%= f.text_field :subject, :size => 60 %><br />
    <%= f.label :body %><br />
    <%= f.text_area :body, :rols => 10, :cols => 60 %><br />
    <%= submit_tag "Send Email "%>
<% end %>

That’s about it really, you may want to add your own error handling as this example only covers the basics. If you go to the contact page you can see a working example of the above tutorial in action. There are probably easier ways of doing this than the method I have described, but I like my method and hopefully it will work for you.

Update: The code in this post was updated for Rails 2.0.x on 17th March 2008.

Update: Modified the settings code to be ‘smtp_settings’ rather than ‘server_settings’, thanks goes to Lyle for discovering the problem (below).

Update: Modified the code to work for Rails 2.3.x onwards (but not Rails 3).

Posted
17 Jul 2006 @ 21:06

Categories
, ,

Comments
None

Author
Alex

Little Snitch, iSyncIt & The Website

The first topic of todays post is Little Snitch. For those of you that do not know this Mac OS X software, it is a small utility that warns of outgoing connections and allows them to be blocked if necessary. It can be downloaded here. The main reason I am mentioning it is that I have received an email today from a worried user of iSyncIt that was informed by Little Snitch of iSyncIt checking in with boycie.primehosting.co.uk. This is perfectly normal as this is the websites hosting server so it is OK to allow the connection with Little Snitch, iSyncIt is just checking for updates.

Version 0.6 of iSyncIt is out with the advertised bug fixes. I have also rewritten all the code so the memory footprint is much smaller. The general appearance of the application (especially the preferences panel) has also been improved.

I have also received an email from my web host to inform me that my account may be moved to a different hosting server. This may cause a very short amount of downtime in the coming days. It could also cause Little Snitch to report a different server, but it is still OK.

Posted
11 Jul 2006 @ 10:47

Categories

Comments
None

Author
Alex

I Use This

Whist I was browsing my favorite blog (TUAW) today an interesting post popped up. It seems that some guys known only as Arne and Marcus have started a website that is sort of a cross between MacUpdate and del.icio.us. I think it’s a brilliant idea and should be supported so hop on over to iusethis.com, get registered and get adding. Plus if your a user of iSyncIt you can let me know. (See there is always another motive for blog posts).

Posted
11 Jul 2006 @ 10:42

Categories
,

Comments
None

Author
Alex

Feature Frozen

Version 0.5 of iSyncIt is now in the wild. I can’t actually think of anything else to add to it at the moment so this will be the feature frozen release for now. Any subsequent releases, probably up to version 1.0 (if I get that far) will just be bug fix releases, I also plan on optimizing the code in these releases to give a smaller memory footprint and a faster run time.

Posted
06 Jul 2006 @ 21:11

Categories
,

Comments
None

Author
Alex

Hidden Dock Icon

Unfortunately (primarily due to my lack of programming knowledge) I have not yet found a way to give the user an option of choosing whether or not to show the dock icon. I personally think that the menu bar item is more useful for iSyncIt so the dock icon will remain hidden for now. If any programmers out there know how to achieve the choice of dock hiding in Obj-C then feel free to contact me.

On that bombshell, iSyncIt 0.4 has now been released. All of you using automatic updates in 0.3 should receive it straight away but for everyone else it is available from the software section or you can get it from MacUpdate and let me keep track of the number of downloads. All the changes in this version are on the software page.

Posted
03 Jul 2006 @ 15:25

Categories
,

Comments
None

Author
Alex

iSyncIt 0.3

iSyncIt 0.3 is now available in the wild. The most obvious changes in this release are the removal of iSyncIt’s dock presence and the introduction of a menu bar item instead. This also means that iSyncIt can be added to your login items and you can have much easier access to your syncing. Future updates of iSyncIt will now be handled through the Sparkle update engine. View more about iSyncIt here.

Posted
01 Jul 2006 @ 21:22

Categories
,

Comments
None

Author
Alex

Everything on MacUpdate & iSyncIt

I have now uploaded all of my applications onto MacUpdate and to my surprise they appear to be getting quite alot of downloads. Luckily it does not appear to be affecting my bandwidth yet even though my hit count has risen rapidly.

I am now in the progress of updating iSyncIt to version 0.3. The major changes that will feature in the next release are; a dock menu and menu bar item for easier syncing and a properly compiled application instead of an AppleScript application.

(Apologies to anyone who has already recieved this post, or something similar too it, the original disappeared off the server for some reason so I have had to re-write it to restore it.)