search for: posts_path

Displaying 12 results from an estimated 12 matches for "posts_path".

2010 Apr 14
0
Rails 3 (beta3) and paths in the console
Did I miss some release note somewhere? I used to be able to, from the Rails console, get paths and urls using: app.posts_path or app.post_path(p) Now, trying to do that, I get an error stating that those methods are protected? irb(main):001:0> app.posts_path NoMethodError: protected method `posts_path’ called for #<actiondispatch::integration::session:0x3bf67c0> (Windows, Rails 3beta3, Ruby 1.9.1p378) Thanks...
2011 Apr 30
8
"uninitialized constant PostsController::Post"
This time i read scaffold tutorial very carefully and finally try to generate a form without using the scaffold(just used a controller and view ).what i have done till now ,is as follow.Using rails 3.0.7. "rails generate controller posts index" 1) post_controller.rb class PostsController < ApplicationController def index @post=Post.new
2011 Feb 20
3
ugly url form_tag
...looks like : http://localhost:3000/posts?utf8=%E2%9C%93&search=rails The utf8 attributes is pretty much ugly. Is there a way (in Rails 3) the url looks like something like : http://localhost:3000/posts/search/rails If yes what do I need to change in my code ? Here is my code <% form_tag posts_path, :method => ''get'', :class => "mainsearch" do %> <%= text_field_tag :search, params[:search], :class => "keyword" %> <%= submit_tag '''',:class => "submit" %> <% end %> Cheers Moon -- Posted...
2009 Jul 26
2
How knows my paths in link_to? If I do not defined.
...is: app/views/posts/index.html.erb: <td><%= link_to ''Show'', post %></td> <td><%= link_to ''Edit'', edit_post_path(post) %></td> Other path(home/index.html.erb): <%= link_to "My first blog in Ruby on Rails", posts_path %> I need help to know how Ruby knows the path of "post", "edit_post_path(post)" and "posts_path"? Thank you all! ps: The link that I´m following: http://guides.rubyonrails.org/getting_started.html#creating-the-blog-application -- Posted via http://www.ruby-foru...
2010 Apr 17
1
Nil.to_sym Problem
.../index.html.erb where line #59 raised: You have a nil object when you didn''t expect it! The error occurred while evaluating nil.to_sym Extracted source (around line #59): 56: <% end %> 57: </ol> 58: 59: <div id="hub">Blog: <%= link_to "(manage)", posts_path(@blog) %></ div> 60: <div id="hubtwo"><%= render :partial => "user/blog" %></div> 61: 62: -- 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...
2008 Jul 17
4
A Mongrel parsing bug: "&" and "&amp;"
When using url_for to send path to a script (such as with auto_complete), multiple params are joined with the "&amp;" code. For example: text_field_with_auto_complete :blog :post, {}, { :posts_path(:a => 1, :b => 2), :method => :get } Produces this script: var blog_post_auto_completer = new Ajax.Autocompleter(''blog_post'', ''blog_post_auto_complete'', ''/posts.js?a=1&amp;b=2'', {method:''get''}) Notice that &quot...
2013 May 04
21
Getting started w/ Rails 4
Hi. I''m trying to run Getting started tutorial under Rails 4.0.0.beta1 although it assumes it runs on Rails 3. I was able to get rid of all errors by wrapping post_params here and there, and installing protected_attributes Gem for attr_accessible to make sense. Post/ comment CRUD works just fine, but I don''t seem to be able to add Tags (the final part of the tutorial). Post saved
2012 Apr 09
8
Rails Functional Testing Problem
...ts = Post.all(:order => "created_at DESC") respond_to do |format| format.html end end def create @post = Post.create(:message => params[:post]) @post.user_id = current_user.id respond_to do |format| if @post.save format.html { redirect_to posts_path } format.js else flash[:notice] = "Message failed to save." format.html { redirect_to posts_path } end end end end ____ I have the same error when trying to writer other functional tests, in other models which involve creating a record in my pro...
2007 Sep 05
0
Savage Beast plugin: Question on the reply form
.... The code looks like this ... <div id="reply" class="editbox"> <div class="container"> <%= content_tag ''p'', h(flash[:bad_reply]), :class => ''notice'' if flash[:bad_reply] %> <% form_for :post, :url => posts_path(:forum_id => @forum, :topic_id => @topic, :page => @topic.last_page) do |f| -%> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td rowspan="2" width="70%"> <%= f.te...
2014 Mar 31
0
Unable to delete post in sample blog application
...st_id" = ? [["post_id", 2]] Rendered posts/show.html.erb within layouts/application (9.0ms) Completed 200 OK in 120ms (Views: 117.3ms | ActiveRecord: 0.2ms) My destroy method in the controller is: def destroy @post = Post.find(params[:id]) @post.destroy redirect_to posts_path end The code in the index view is: <td><%= link_to 'Destroy', post, method: :delete, data: {confirm: 'Are you sure?'} %></td> Would anyone have any idea what I might be missing here? Any help appreciated Peter -- You received this message because...
2010 Feb 25
10
ajax.updater problem
...type="text/javascript"> { new Ajax.PeriodicalUpdater(imagen, ''image_tag("/guarrada/guarrada/foto.jpg")'',{frequency:''1''}); } </script> <h1>HOLA MUNDO</h1> <%= link_to "My blog", posts_path %> <p><%=image_tag("/guarrada/guarrada/foto2.jpg") %></p> <div id="imagen"> <%=image_tag("/guarrada/guarrada/foto.jpg") %> </div> THANKS!!!! -- Posted via http://www.ruby-forum.com/. -- You received this message because you ar...
2011 May 20
4
Unable to figure out why a photo attribute of the paperclip plugin is not being passed in as a param
...> <b>Message</b><br /> <%= f.text_field :message %> </p> <%= f.file_field :photo%> <p> <%= f.submit "Create" %> </p> <% end %> <%= link_to ''Back'', posts_path %> A glimpse of what is being passed as part of the params as per the log looks something like this wrt the POC running:- **Case 1** Processing PostsController#create (for 127.0.0.1 at 2011-05-20 15:55:00) [POST] Session ID: BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxh...