Form tiles in a rectangular ring Given the input tilesX and tilesY create a method that would make a rectangular ring from the tiles.

The function must order the tiles in a ring like this:




tilesX and tilesY are always positive integer values, cannot be 0
tilesX and tilesY are not always equal, expect values like: 2x5, 6x3 etc.
Checking for invalid input is not necessary
You can use any way to display the tiles, including 2d arrays, ASCII art or printed text.
There's no strict way how the input is passed as long as it's two integers.
Cannot be a line, drawing a rectangle size of tilesX and tilesY pixels is not valid
The shortest code wins
Dyalog APL, 8 bytes

×/¨1&lt;⊂|⍳


This monadic function train takes height and width as right arguments and returns a 2D array of 0's (border) and 1's (interior). Test it on TryAPL.

How it works

×/¨1&lt;⊂|⍳  Right argument: h w

       ⍳  Generate all index pairs (1-based) of a h×w array.
     ⊂    Enclose (h w), so it depth matches the one of the index array.
      |   For each pair (i j) compute the remainders of the division by (h w).
   1&lt;     Compare all remainders with 1.
×/¨       Reduce each pair of Booleans by multiplication.