Displaying 5 results from an estimated 5 matches for "edit_user_path".
2008 Feb 29
3
How to DRY REST admin path in URLs?
Hi everyone...
For almost all of my objects I put a series of classic REST admin links
in views. For example, for a ''user'', I have
<%= link_to "Show", user_path(user) %>
<%= link_to "Edit", edit_user_path(user) %>
<%= link_to "Destroy", user_path(user), :confirm => "Are you sure",
:method => :delete %>
I am tired of writing those links down over and over and look for a way
to DRY it a little bit.
I am thinking about a helper method allowing me to write a simple
&...
2008 Jan 21
7
undefined method error
...ew_entry_path'' for #<ActionView::Base:0x52fa56c>
Extracted source (around line #12):
9: <% if is_logged_in? %>
10: <li>Logged in as: <i><%= logged_in_user.username %></i></li>
11: <li><%= link_to ''My Profile'', edit_user_path(logged_in_user)
%></li>
12: <li><%= link_to ''New Blog Post'', new_entry_path(:user_id =>
logged_in_user) -%></li>
13: <li><%= link_to ''Upload Photo'', user_new_photo_path(:user_id
=> logged_in_user) -%></li>...
2010 Nov 07
1
Strange authlogic logout behavior
...ew
end
end
def destroy
current_user_session.destroy
flash[:notice] = "Logout complete. Have a nice day!"
redirect_to root_url
end
end
[/code]
application layout file snippet
[code]
<% if current_user %>
<li><a><%= link_to current_user.login, edit_user_path(:current)
%></a></li>
<li><%= link_to "logout", user_session_path, :method => :delete %></li>
<% else %>
<li><%= link_to "log In", new_user_session_path %></li>
<% end %>
[/code]
--
Posted via http://www.ruby...
2009 Jan 16
16
Testing arbitrary post action parameters
I am working on our (newly renamed) authentication feature. The current
scenario is:
Scenario: Non-administrators should not set administrator ability
Given I have no users
And I add a user named "admin" as an administrator
And I add a user named "myuser" as not an administrator
When the user named "myuser" authenticates
And the user
2011 Jul 14
10
Devise confusing routes
I had a similar problem yesterday.
I would go to the root of my site and I would get a Too Many Redirects
message. It seems like there was an infinite loop. After struggling for
over an hour yesterday late at night, it seemed like I fixed it.
But now, when I want to create a New User, it''s redirecting me to the
Sign In screen. Seems like I didn''t fix the problem completely.
I