What I have tried in the past is simply nailing a straight board to the board I want to cut
In essence that's a very good method to do it, and will even work even if the board you're working has very uneven edges, e.g. a live edge (UK: waney edge).
I would recommend you not use nails ideally, you can hold the board securely without having to mark it. Below are a few options.
Table saw
Additionally, you can use the mitre slot instead of the existing fence as your straight reference, this may help to reduce the risk of kickback.
Router
It's a shame you don't have a router as there are many good router-based options for edge jointing and a sharp router bit leaves a particularly good glue surface for a power tool. Here's one simple and effective design:
[Source: ShopNotes #8]
Handtools
This is of course doable just with hand tools, as that is how boards made flat, square and true in the past.
Traditionally a jointer would be used for this as its name would suggest (although they were also called try planes or trying planes). You can do this with a no. 4 or smoothing plane, but at only about 9" / 23cm long it's a little too short to do the job as effectively as one would like — a shorter plane can more easily ride up and down over irregularities rather than skating over the top of them as preferred.
When jointing edges by hand, in addition to the physical planing work it's important to first mark out your boards well, on both faces and both ends, and then work down to your line.
Even with marked/gauged lines to work to planing long board edges flat and square to the face is fairly challenging. So over the years various jigs and fence systems have been devised, especially to help less-experienced plane users do the job.
One particularly good solution is shown below, starting with just a common block plane. By effectively extending its bed length with the infeed and outfeed 'tables' it gives a true jointing effect, even though the plane at the heart of it is a mere 6" / 15cm long.
[Source: ShopNotes #19]