This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create | |
@micropost = Micropost.find(params[:micropost_id]) | |
@answer = @micropost.answers.create(params[:answer]) | |
redirect_to micropost_path(@micropost) | |
end | |
def edit | |
@micropost = Micropost.find(params[:micropost_id]) | |
@answer = @micropost.answer.find(params[:id]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I look for solutions for NoMethodError and tried to switch the @answers by @answers | |
# I tried to redirect the route of answers#index | |
# The issue happen when I click on "Back" from any page of the answer view, after editing # an "Answer" or when i land on "http://localhost:3000/answers" since the back button | |
# redirect me toward this page. I thought the issue could be the name of my path but I | |
# wasn't able to fix it. I am quite confused that @answer is returned as nil when i click # on back | |
#======================================== | |
# Error message I get from : http://localhost:3000/answers | |
#======================================== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
osiris:~ evenix$ sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql | |
Password: | |
Building native extensions. This could take a while... | |
ERROR: Error installing mysql: | |
ERROR: Failed to build gem native extension. | |
/Users/evenix/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb --with-mysql-dir=/usr/local/mysql | |
checking for mysql_query() in -lmysqlclient... no | |
checking for main() in -lm... yes | |
checking for mysql_query() in -lmysqlclient... no |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using bundler (1.0.14) | |
Installing mysql (2.8.1) with native extensions /Users/Richardson/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:551:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) | |
/Users/Richardson/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb | |
checking for mysql_query() in -lmysqlclient... no | |
checking for main() in -lm... yes | |
checking for mysql_query() in -lmysqlclient... no | |
checking for main() in -lz... yes | |
checking for mysql_query() in -lmysqlclient... no | |
checking for main() in -lsocket... no |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NoMethodError in Deals#edit | |
Showing /app/views/deals/_form_edit.html.erb where line #26 raised: | |
undefined method `merge' for 2011-12-12 07:43:35 -0700:Time | |
Extracted source (around line #26): | |
23: </p> | |
24: <p> | |
25: <%= f.label :start_time%><br /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is based on an assignment from http://ruby.learncodethehardway.org/book/ex48.html | |
it seem that the test fail once it tries to scan more than one words, | |
since 'result' return only one pair and does not match the expected result |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def new | |
@micropost = Micropost.new(:tag => '4' ) | |
# Change the value of 'Micropost.find(..).to_guys' to True or False depending on what button was pressed | |
if request.post? | |
if params[:name].include?( 'to_guys' ) | |
@micropost.to_guys = true | |
flash[:notice] = 'This post was sent to guys' | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What I am trying to do is: while I am using paginate and navigating through the pages, I want the user to be able to click on a micropost.content and be redirected to the micropost 'display' view as I am using the show view for the admin side. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span id="containerright"> | |
<div class="logo"><%= image_tag("home_logo.png")%></div> | |
<% @micropost = Micropost.new %> | |
<%= render :partial => 'microposts/form2', :locals => { :micropost => @micropost } %> | |
</div> | |
</span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Gigiki</title> | |
<%= stylesheet_link_tag "application", :media => "all" %> | |
<%= javascript_include_tag "application" %> | |
<%= csrf_meta_tags %> | |
</head> |
OlderNewer