# GET system_accounts/:id
def show
# If a system account already exists in session, it was found from a search with the account id
# Otherwise, this is a new search for a system account by the given id
if params[:id]
Rails.logger.debug { "Querying for the account with id: #{params[:id]}" }
response = query_account(CGI.escape(params[:id]))
if response.is_a?(Net::HTTPSuccess)
@account = JSON.parse(response.body)
unless @account.empty?
redirect_to system_accounts_path(params[:id])
end
end
The above is my show action. So the thing is if i search with my id=2 i should get the resultant link to be system_accounts/2 but what i get is system_accounts.2 . why a . instead of a / . Anything i am missing out on ?
if you are closely following the rails convention, you should use
system_account_path(params[:id])(without ans). 2 is interpreted as the format so it is appending.2to the url becausesystem_accounts_pathmost probably points to the index action of system_accounts controller. remove the s to point to the show action.