You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo "gem 'webpacker'" >> Gemfile
bundle install
rails webpacker:install
# above fails on my machine, below does the same
# bin/rails app:template LOCATION=/Users/sune/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/webpacker-4.0.2/lib/install/template.rb
rails webpacker:install:react
# above fails on my machine, below does the same
# bin/rails app:template LOCATION=/Users/sune/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/webpacker-4.0.2/lib/install/react.rb
yarn upgrade
bin/rails server
bin/webpack-dev-server
importReactfrom'react';functionAppointmentsTable({ appointments }){return(<table><thead><tr><th>Name</th><th>Date</th><thcolSpan="3"></th></tr></thead><tbody>{appointments.map(({ id, name, date })=>(<trkey={id}><td>{name}</td><td>{date}</td><td><ahref={`/appointments/${id}`}>Show</a></td><td><ahref={`/appointments/${id}/edit`}>Edit</a></td><td><ahref={`/appointments/${id}`}data-method="delete"data-confirm="Are you sure?">Destroy</a></td></tr>))}</tbody></table>)}exportdefaultAppointmentsTable
Fjern appointments data fra rails view appointments/index.html.erb
Setup component
importReactfrom'react';importApolloClientfrom"apollo-boost";import{ApolloProvider}from"react-apollo";constclient=newApolloClient();functionSetup({ children }){return(<ApolloProviderclient={client}>{children}</ApolloProvider>)}exportdefaultSetup;
This file contains 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 file contains 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 file contains 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 file contains 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