search for: users_path

Displaying 14 results from an estimated 14 matches for "users_path".

Did you mean: user_path
2008 Jan 17
4
multiple views, and some routers
...router that when I type /users/1 search for the user with id = 1 how do i call the list.html.erb page? because, when i type /users/list i get an error because it''s trying to search for an id = list (?) what would be the correct way to map this on routers.rb ? i have some doubts about the users_path, users_url, when scaffold generates the page he calls new_user_path for example. I didn''t understand how that is possible. If i creat that list.html.erb page on the users folder, will i be able to call an list_user_path ? Sorry if my questions look a little too beginner, maybe i missunder...
2007 Mar 14
11
path vs. url
When using named RESTful routes, when should one use the generated ..._path helpers, and when the ..._url helpers? Say I did this in routes.rb: map.resources :users Where should I use users_path, new_user_path, etc., and where should I use users_url, new_user_url...? Thanks! Steve --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to ruby...
2007 Apr 11
13
View Specs Fail with "protected method render"
...!(:count).and_return(0) @user = mock_user @user.stub!(:errors).and_return @errors assigns[:user] = @user end specify "should render new form" do render "/users/new.rhtml" response.should_have_tag ''form'', :attributes =>{:action => users_path, :method => ''post''} end end Can anyone think of why "render" is protected? Is this a versioning issue? Thanks - Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070410/5...
2009 Dec 23
8
Where did this value in a form come from?
Newb here. I have a form and a value that is being displayed ... and I have no idea where the value came from. I have done a <%= debugger; '''' %> in the form and, indeed, the debugger stops at the statement. I have tried to trace through the code to see where the value came from ... and I gave up. So ... what in Rails initializes the fields of a form? -- Posted via
2008 Nov 26
1
Clearing form fields for a popup
I am using prototype to create modal popups for my login and register pages, but the fields are populating with the data from certain variables. For example, I have a show page that finds a user like so: @user = User.find(params[:id]) and my form uses: <% form_for :user, :url => users_path do |f| -%> so it is populating the form with the data from @user. Should I rename the @user variable, or is there a way to avoid the populating of the form? Thanks for any help. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the G...
2013 Apr 12
1
What is the meaning of the method to_param?
Hey! Foe example i have next code: test "should update user" do put :update, id: @user.to_param, user: @input_attributes assert_redirected_to users_path end What return id: @user.to_param? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+...
2006 May 21
3
find with belongs_to -> belongs_to -> belongs_to
I have 3 tables keywords (keywords attached to a file) files (info about the file) paths (path for the file) [This is a legacy database, so I can''t change this] keyword belongs_to file and file belongs_to path. Users need to be able to search the keywords, but they only have access to certain volumes, so the results need to be limited by the path. I also need to show paging,
2010 Jun 23
0
Rails 3 - AJAX Response
...d:ok} end end end end def change_type unless params[:change_type_value] if @user.category == 5 @user.category = 0 else @user.category = 5 end respond_to do |format| if @user.save format.html { redirect_to( users_path, :notice => "Sucessfully changed " + @user.name.titleize + "''s category" ) } format.js else format.html { redirect_to( users_path, :notice => "Failed to change " + @user.name.titleize + "''s category" ) }...
2007 Oct 22
1
View spec response has no content?
...:href => reservations_path, :text => ''Reservations''}) response.should have_tag(''a'', :attributes => {:href => reports_path, :text => ''Reports''}) response.should have_tag(''a'', :attributes => {:href => users_path, :text => ''Users''}) end it ''should display a logout link'' do response.should have_tag(''a'', :attributes => {:href => session_path, :text => ''Logout''}) end end describe ''/main/index GET'&...
2014 Jun 08
0
Re-render partial inside a modal
...ng new sign up page if user inputs incorrect information! * def create @user = User.new(user_params) if @user.save # session[:remember_token] = @user.id # @current_user = @user # session[:remember_token] = @user.id.to_s flash.now[:success] = "You have succesfully signed up!" redirect_to users_path else render 'new' end end *What I actually want to accomplish is rerendering the partial inside the modal once User.save does not work. Please help!!!! :(* -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group....
2008 Jul 12
6
Create db row in my partial template
...;br /> <%= f.text_field :email %> </p> <p> <%= f.label :password %><br /> <%= f.text_field :password %> </p> <p> <%= f.submit "Create" %> </p> <% end %> <%= link_to ''Back'', users_path %> I have no real clue what the new.html.erb code does. I''m trying to replicate this form in my own template, but obviously it doesn''t work. Can someone advise me please, thanks! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----...
2010 Sep 09
17
formtastic issue
...t created a new rails 3 app, then I created a new controller... rails generate controller admin::users I didn''t forget to add the resources in the routes.rb file like this. namespace :admin do resources :users end Now I try to use formtastic to create the form but I get erorr that my users_path doesn''t exist? undefined method `users_path'' for #<#<Class:0x104169a40>:0x104167df8> ...even though I have created resources for users. Can someone explain to me what''s happening. Thanks for any help :D //James -- Posted via http://www.ruby-forum.com/....
2010 Jan 26
2
accepts_nested_attributes_for :has_many :through => 'bug?'
...b class Company < ActiveRecord::Base has_many :company_users has_many :users, :through => :company_users end -------------- company_user.rb class CompanyUser < ActiveRecord::Base belongs_to :user belongs_to :company end -------------- My form <% form_for :user, :url => users_path do |f| -%> <p><%= label_tag ''First name'' %> <%= f.text_field :firstname %></p> <p><%= label_tag ''Surname'' %> <%= f.text_field :surname %></p> <p><%= label_tag ''email'' %> <%= f....
2007 Oct 12
13
How to maintain Form State between Postback ?
Hi all, I''ve trying to look for answers for my problem but so far couldn''t find one, hopefully you can tell me what to do. This problem is so ubiquitous to Web Development, pertaining the fact that the web is stateless, i.e. how to maintain form''s state between postback. Basically, I have a form with some validations run for some of the fields, whenever the user submit