I am working through the Rails Views chapter in the RSpec Book and
noticed something odd when I created a spec for the edit view. I am
getting the wrong value from the messages_path helper. I was kind of
wondering if it would work or not - but had expected it to fail by not
giving me an id, not by
On Nov 26, 2011, at 2:38 PM, Cynthia Kiser wrote:
> I am working through the Rails Views chapter in the RSpec Book and
> noticed something odd when I created a spec for the edit view. I am
> getting the wrong value from the messages_path helper. I was kind of
> wondering if it would work or not -
> I can work around it by constructing the url myself with
> "/messages/#{message.id}" but I am curious where the period is coming
> from in the constructed url.
It's because you should be using a singular resource name to signify that you
are updating an existing record. I believe you want to d
Quoting Patrick J. Collins :
> > I can work around it by constructing the url myself with
> > "/messages/#{message.id}" but I am curious where the period is coming
> > from in the constructed url.
>
> It's because you should be using a singular resource name to signify that you
> are updating an
On Nov 26, 2011, at 8:03 PM, Cynthia Kiser wrote:
> Quoting Patrick J. Collins :
>>> I can work around it by constructing the url myself with
>>> "/messages/#{message.id}" but I am curious where the period is coming
>>> from in the constructed url.
>>
>> It's because you should be using a singu
Quoting Justin Ko :
> Run "rake routes" and you'll see what the two "paths" generate.
Rake routes didn't really give me much insight - but playing around in
the console did. Any argument to messages_path gets interpreted as a
format - even an integer.
> app.messages_path(:pdf)
=> "/messages.pd