Displaying 20 results from an estimated 50000 matches similar to: "0.0.0.0:300 --> this web page isnot availabe"
2010 Jan 18
8
Comment syntax and strange partial rendering
Using rails 2.3.2 I have a partial _foo.rhtml that begins with a comment
as follows:
<% # here is a comment %>
<li><%= foo %></li>
When I render the partial from a view in the traditional way, e.g.
<% some_numbers = [1, 2, 3, 4, 5] %>
<ul>
<%= render :partial => "foo", :collection => some_numbers %>
</ul>
I
2010 Jul 02
17
Doesn't work erb engine
I''m new in RoR:)
I have controller and view (/app/controllers/greeting_controller.rb
and /app/views/greeting/index.rhtml /.erb/.html.erb - doesn''t match).
greeting_controller.rb source:
class GreetingController < ApplicationController
def index
@message = "Hello world!"
end
end
index.rhtml source:
<html>
2012 Nov 26
5
Missing template pages/layout only occasionally
I have my app email me errors when they occur. I get this about 2-3
times a week with thousands of hits a day to the site. pages/show is a
.html.erb file that renders the partial
_strategicrelationshipacademy.html.erb essentially. Or whatever partial
it calls for. I get this on many different ''pages''. Obviously the
partial exists if it renders it fine most of the time. What
2011 Jan 24
11
Can't get login to work
Hi, could anybody help me try to get a login function working, I have
created a database for users called user1, I have the login screen set
up but when i hit login with a correct username and password, nothing
happens
I am expecting the lgin button to direct the user to the main page and
show the user as logged on, but nothing happens! Thanks!
Controller
class User1Controller <
2011 May 20
5
views w locale default template
[RAILS3]
I hesitate on how handling the locale view templates to default to
one language only ..
sending admin emails will go only to one locale ''en_GB''
should I set it up into the template name and set I18n.locale to
''en_GB''
membership_renew.en_GB.html.erb
OR
whatever locale is used , if I have :
membership_renew.html
it will be the default ?
--
2010 Dec 31
6
HTTP Accept header wildcard breaks rails app
The thunderstone crawler (http://search.thunderstone.com/texis/
websearch/about.html) sends the folliowing HTTP accept header when
requesting pages
Accept: text/*, application/javascript, application/x-javascript
This results in a "Missing template" exception
text/* is valid. How do I tell my rails app to treat this as rhtml by
default instead of returning a 500?
Missing template
2011 Apr 18
2
acts_as_commentable validations
Hi all,
I recently started back up with Rails and things are going well up until
now.
I''ve set up acts_as_commentable in my Post model and it''s working great.
Problem is users are able to create a "blank" comment. I''ve added the
following validations in the comment.rb file generated by
acts_as_commentable to limit the comment length:
[code]
2010 Aug 13
11
Link to remote and the equivalent in Rails 3
Hi
WOW! Is Rails 3 another interesting learning curve. Just when I think
I have a general working knowledge of Rails 2 ... things change.
I''m trying to replicate the following in Rails 3:
<%= link_to_remote image_tag("creditcard.png", :border => 0), :url =>
{:action => :make_payment, :type => "Credit", :id =>
@appt.id },
2013 May 31
11
A simple javascript alert not working
If I have a file in view /test called index.js.erb and in it a simple
alert("hello") shouldn''t that run when I go to /test/index? It doesn''t.
--
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,
2011 Jul 27
20
Rails, jquery and Ajax
How do I make an ajax call and then update a div with a partial? I''ve
tried this but it''s not working. Comment is created but the partial is
not loaded.
//view
<a href="#" id="testlink">Testlink</a>
<div id="commentlist">
</div>
//controller
def new
@comment = Comment.new
@comment.save
2012 Jul 17
24
Static Pages from Railcast
Hi everyone,
I need several pages to be static but also modify when requested. I try
following the railcast from Ryan at
http://railscasts.com/episodes/117-semi-static-pages?view=comments
Here what I have done!!
rails g scaffold Pages name:string permanentlink:string title:string
author:string access_level:string is_published:boolean
meta_description:string meta_keyword:string
2011 Jan 05
16
Nicedit (rich text editor)
Hello, I''m trying to use Nicedit to improve my text_areas in some views
of my project.
I have installed jquery:
ruby script/plugin install git://github.com/aaronchi/jrails.git
nicEdit plugin:
ruby script/plugin install
git://github.com/sergio-fry/Simple-nicEdit.git
Add js in layout:
<%= javascript_include_tag ''nicEdit'', ''nicEditInit'' %>
Use it
2011 Jan 15
3
respond_with javascript
My ajax stopped working when I switched to using respond_with. For my
Votes, I have the create action and the corresponding create.js.erb,
and respond_to :html, :js, :xml in the controller. Heres the log when
I try and create a vote:
Started POST "/stories/3-asdfasdf1111/votes" for 127.0.0.1 at Fri Jan
14 20:46:36 -0800 2011
Processing by VotesController#create as */*
Parameters:
2010 Jul 19
6
Setting a root_url
I know how to setup a roo_url using map.root in "routes.rb".
The issue I''m currently having is as follows:
I walking through this Rails cast regarding Authlogic:
http://railscasts.com/episodes/160-authlogic
I decided that I make my map.root the "login" page, that is, the
index.html.erb of the user_sessions_controller.
So, what I did is typed the following in the
2010 Sep 18
11
Commenting in an ERB without generating a compiling error
Hello,
I have the following:
<% @projects.each do |project| %>
<tr>
.
<td><%= link_to ''Destroy'', project, :confirm => ''Are you
sure?'', :method => :delete %></td>
.
</tr>
<% end %>
How can I safely comment out the TD line above? Do I have to use the
=begin way?
--
You received this message because you
2012 Jul 19
6
Rendering Partial
I am a bit confused when coming from layout and partials.
To start of I have a file called application.html.erb which has my
layout such has follow
<html>
<head>
<body>
<%= render ''layouts/footer'' %>
</body
</html>
This call a new file _footer.html.erb
This file his has follow
<footer class="footer">
<nav>
<%=
2010 Mar 29
4
error in uploading file(help me urgnt)
when i tried to crate an upload file application in rails i am getting
error like this
Template is missing
Missing template app\views\upload\uploadfile.html.erb in view path
app/views
this is ma model
class DataFile < ActiveRecord::Base
def self.save(upload)
name = upload[''datafile''].original_filename
directory = "public/data"
# create the
2012 Nov 18
3
Share partial among different resources
I am trying to render a file from Subject resource in a User resource
view. I am getting error:
undefined method `each'' for nil:NilClass. Apparently @subject is nil
but not sure how to fix this...
Here is User resourve view (users/show.html.erb)
<%= render ''subjects/index'' %>
Here is subjects_controller
def show
@subject = Subject.find(params[:id])
...
2011 Mar 01
6
render :collection calling partial with phantom object?
I have two models with a straightforward has_many / belongs_to
relationship:
class Premise < ActiveRecord::Base
has_many :metered_services, :dependent => :destroy
...
end
class MeteredService < ActiveRecord::Base
belongs_to :premise
...
end
and nested routes to match:
Demo::Application.routes.draw do
devise_for :users
resources :premises do
resources :metered_services
2010 Jul 27
7
trouble with remote_form_for & html_update
I have a form that accepts comments and adds them to a list without
refreshing the page.
This is the html:
<div id=''aremark''>
<%= render :partial => ''comment'' %>
</div>
<% remote_form_for :comment, :url=>story_comments_path(@story), :html
=> { :id => ''comment'' } do |form| %>
<h5><label